spring: Spring is broken with bundler >= 1.11.0

After https://github.com/bundler/bundler/pull/4002 (which is included into 1.11.0 and up) bundler restores RUBYLIB env var, but it seems that spring actually needs former behavior. spring-1.6.0 (rails-4.2.5) w/ bundler >= 1.11.0 fails like this:

ojab-notebook:dashboard-ng ojab$ bundle exec rails c
/Users/ojab/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- bundler/setup (LoadError)
    from /Users/ojab/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/ojab/Documents/repos/phones/dashboard-ng/vendor/bundle/ruby/2.2.0/gems/spring-1.6.0/lib/spring/commands.rb:33:in `<module:Spring>'
    from /Users/ojab/Documents/repos/phones/dashboard-ng/vendor/bundle/ruby/2.2.0/gems/spring-1.6.0/lib/spring/commands.rb:4:in `<top (required)>'
    from /Users/ojab/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/ojab/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/ojab/Documents/repos/phones/dashboard-ng/vendor/bundle/ruby/2.2.0/gems/spring-1.6.0/lib/spring/application.rb:77:in `preload'
    from /Users/ojab/Documents/repos/phones/dashboard-ng/vendor/bundle/ruby/2.2.0/gems/spring-1.6.0/lib/spring/application.rb:143:in `serve'
    from /Users/ojab/Documents/repos/phones/dashboard-ng/vendor/bundle/ruby/2.2.0/gems/spring-1.6.0/lib/spring/application.rb:131:in `block in run'
    from /Users/ojab/Documents/repos/phones/dashboard-ng/vendor/bundle/ruby/2.2.0/gems/spring-1.6.0/lib/spring/application.rb:125:in `loop'
    from /Users/ojab/Documents/repos/phones/dashboard-ng/vendor/bundle/ruby/2.2.0/gems/spring-1.6.0/lib/spring/application.rb:125:in `run'
    from /Users/ojab/Documents/repos/phones/dashboard-ng/vendor/bundle/ruby/2.2.0/gems/spring-1.6.0/lib/spring/application/boot.rb:18:in `<top (required)>'
    from /Users/ojab/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/ojab/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from -e:1:in `<main>'

sping app/server starts fine:

ojab            23200   0.1  0.1  2480972  11048   ??  Ss    4:38PM   0:00.12 spring app    | dashboard-ng | started 9 secs ago | development mode
ojab            23198   0.0  0.3  2505632  23612 s005  S     4:38PM   0:00.32 spring server | dashboard-ng | started 9 secs ago

Issue for bundler is filled (https://github.com/bundler/bundler/issues/4165), but I’m not really sure that it is their bug.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 38 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Updating Rails binaries worked for me bundle exec rake rails:update:bin

Hey, I hit this issue, too, and regenerating binstubs with

bundle exec spring binstub --all

seems to have fixed it.

@MatayoshiMariano your suggestion of running the rails:update:bin rake task saved the day for me as the main cause of my problem was I updated all my gems and rails (5.0.1) updated to rails (5.0.2).

Thought I’d share the root cause of my spring issues…

If you’re on rails 5.0.1 update all your gems via bundle update then run be rake rails:update:bin and you’ll be good! 😃