Skip to content

rails g react:install fails with "uninitialized constant React::Rails::Application" #459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
FreeApophis opened this issue Jan 27, 2016 · 4 comments

Comments

@FreeApophis
Copy link

Wanted to try react-rails gem, and I followed a beginners tutorial and ran early into this problem:

on issuing: rails g react:install

C:/Users/Apophis/Downloads/Projects/react/config/application.rb:10:in `<module:React>': uninitialized constant React::Rails::Application (NameError)
        from C:/Users/Apophis/Downloads/Projects/react/config/application.rb:9:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:141:in `require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:141:in `require_application_and_environment!'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:128:in `generate_or_destroy'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:50:in `generate'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

Freshly created rails app with Rails 4.2.5.1 / react-rails is the only gem I added by hand to the Gemfile. The bundle install worked without a problem "Using react-rails 1.5.0"
I searched for a bug and landed on Report #331 - It does not look like they are related, reorder did not help and I have only the standard gems in the Gemfile.

The installation is on windows, and here is my Gemfile.lock

@rmosolgo
Copy link
Member

Huh, I wonder where that's coming from. Could you share this file too?

C:/Users/Apophis/Downloads/Projects/react/config/application.rb

That looks like the first trigger of the bug, but I'm not sure what's in that file!

@FreeApophis
Copy link
Author

The Problem was indeed in that File:

module React
  class Application < Rails::Application
  end
end

The problem was that I created a new app with the name react: Solution DO NOT create an application with the name react, any other name works like a charm. That was bad luck.

rails new react

Thanks, case closed

@rmosolgo
Copy link
Member

wow, crazy! glad you got to the bottom of it!

@pastullo
Copy link

hahah just got the same exact error, fresh new app called react to try this out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants