Skip to content

Can't install it.. - Rails 4.2 #331

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
dyatlov opened this issue Aug 5, 2015 · 17 comments
Closed

Can't install it.. - Rails 4.2 #331

dyatlov opened this issue Aug 5, 2015 · 17 comments

Comments

@dyatlov
Copy link

dyatlov commented Aug 5, 2015

rails g react:install

/home/vagrant/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/react-rails-1.1.0/lib/react/rails/railtie.rb:42:in `block in <class:Railtie>': undefined method `version' for nil:NilClass (NoMethodError)
        from /home/vagrant/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `instance_exec'
@rmosolgo
Copy link
Member

rmosolgo commented Aug 5, 2015

Could you post your gemfile.lock? I think it's a conflict with a Sprockets/sprockets-rails version

@dyatlov
Copy link
Author

dyatlov commented Aug 5, 2015

@vipulnsward
Copy link
Contributor

@dyatlov this is fixed on master. Can you give it a try?

@dyatlov
Copy link
Author

dyatlov commented Aug 5, 2015

@vipulnsward thanks, trying

@dyatlov
Copy link
Author

dyatlov commented Aug 5, 2015

@vipulnsward unfortunately,

vagrant@vagrant:/vagrant$ rails g react:install
/home/vagrant/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/bundler/gems/react-rails-d433c0ddb103/lib/react/rails/engine.rb:5:in `block in class:Engine': uninitialized constant React::Rails::Engine::Sprockets (NameError)

@ncri
Copy link

ncri commented Sep 21, 2015

Same here, but a different error from one of my initializers. Seems a class loading issue, as that initializer works fine when loading the app normally. I will install manually...

@ncri
Copy link

ncri commented Sep 21, 2015

Btw.: To avoid name clashes I would call the folder rather react_components than components.

@ncri
Copy link

ncri commented Sep 21, 2015

One more thing: :) The generator assumes the manifest is called application.js. Not true for our projects. It is either application.js.coffee or application.js.coffee.erb here. Would be cool if the generator could also recognize those.

@ncri
Copy link

ncri commented Sep 21, 2015

Ah, turns out the generator error here is not limited to the generator.
In fact I cannot start up the app anymore after installing the gem:

/config/initializers/will_paginate.rb:3:in `<top (required)>': uninitialized constant WillPaginate::ActionView (NameError)
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/engine.rb:652:in `block in load_config_initializer'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.2/lib/active_support/notifications.rb:166:in `instrument'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/engine.rb:651:in `load_config_initializer'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/engine.rb:615:in `each'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/engine.rb:615:in `block in <class:Engine>'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/initializable.rb:30:in `run'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:420:in `block (2 levels) in each_strongly_connected_component_from'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:420:in `block (2 levels) in each_strongly_connected_component_from'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:419:in `block in each_strongly_connected_component_from'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/initializable.rb:44:in `each'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/initializable.rb:44:in `tsort_each_child'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:413:in `call'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:413:in `each_strongly_connected_component_from'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:419:in `block in each_strongly_connected_component_from'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/initializable.rb:44:in `each'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/initializable.rb:44:in `tsort_each_child'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:413:in `call'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:413:in `each_strongly_connected_component_from'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
    from /Users/nico/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/application.rb:352:in `initialize!'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/railtie.rb:194:in `public_send'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/railtie.rb:194:in `method_missing'
    from /Users/nico/Rails/new_yousty/yousty/config/environment.rb:7:in `<top (required)>'
    from /Users/nico/Rails/new_yousty/yousty/config.ru:3:in `block in <main>'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/rack-1.6.2/lib/rack/builder.rb:55:in `instance_eval'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/rack-1.6.2/lib/rack/builder.rb:55:in `initialize'
    from /Users/nico/Rails/new_yousty/yousty/config.ru:in `new'
    from /Users/nico/Rails/new_yousty/yousty/config.ru:in `<main>'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/rack-1.6.2/lib/rack/builder.rb:49:in `eval'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/rack-1.6.2/lib/rack/builder.rb:49:in `new_from_string'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/rack-1.6.2/lib/rack/builder.rb:40:in `parse_file'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/rack-1.6.2/lib/rack/server.rb:299:in `build_app_and_options_from_config'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/rack-1.6.2/lib/rack/server.rb:208:in `app'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/commands/server.rb:61:in `app'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/rack-1.6.2/lib/rack/server.rb:336:in `wrapped_app'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/commands/server.rb:139:in `log_to_stdout'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/commands/server.rb:78:in `start'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:80:in `block in server'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `tap'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `server'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /Users/nico/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

@ncri
Copy link

ncri commented Sep 21, 2015

Fixed it, had to include the will_paginate gem before the react-rails gem in the gemfile.

@rmosolgo
Copy link
Member

Wow, how strange! I never heard of an order dependency in a Rails Gemfile before!

@ncri
Copy link

ncri commented Sep 21, 2015

Yep, odd. But I did have it before. :) I think it probably has to do with what react-rails does when it is required. It seems to load my initializers - not every gem does that. And if the will_paginate gem is not loaded first, the initializer breaks.

@npverni
Copy link

npverni commented Oct 13, 2015

Seeing the same thing with will_paginate. Confirmed that changing the order fixes it.

@npverni
Copy link

npverni commented Oct 13, 2015

This looks like the commit that changed it #347.

Weird that we're both running into issues with will_paginate, so it could also be a will_paginate thing.

I've also been able to fix it by requiring in the will_paginate initializer:

require 'will_paginate/view_helpers'
require 'will_paginate/view_helpers/action_view'

@ebenoist
Copy link

I can confirm a similar load order issue with the mobile-fu gem.

@flowerett
Copy link

I can confirm similar issue with rolify gem
my gemfile:

rails (4.2.4)
react-rails (1.4.2)
rolify (4.0.0)

regarding to RolifyCommunity/rolify#156 there's something wrong in the react-rails initializer

@rmosolgo
Copy link
Member

rmosolgo commented Dec 9, 2016

Sorry, it's been quite a while since I heard about an instance of this issue. If someone finds it again, please let me know and I'll see if any changes to our railtie can fix it!

@rmosolgo rmosolgo closed this as completed Dec 9, 2016
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

7 participants