rails / rails-dev-box

A virtual machine for Ruby on Rails core development
MIT License
2.05k stars 580 forks source link

bundle command fails, attempts to load from non-existent path #147

Closed ghost closed 6 years ago

ghost commented 6 years ago

It appears that rubygems 2.7.5 (released on 6-Feb-2018) introduces an issue with a newly built instance of rails-dev-box. The bundle command fails, referencing a non-existent path:

vagrant@rails-dev-box:~$ bundle --version
/usr/local/bin/bundle:23:in `load': cannot load such file -- /usr/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/exe/bundle (LoadError)
    from /usr/local/bin/bundle:23:in `<main>'
vagrant@rails-dev-box:~$ which bundle
/usr/local/bin/bundle

My environment: Vagrant 2.0.2 Virtualbox 5.1.28 rails-dev-box: 83efeddf8adfe17ee250e5a03a0d489267bf444e

I have done limited research, and see the following:

1) If I access /usr/bin/bundle2.4 directly, bundle executes as expected:

vagrant@rails-dev-box:~$ /usr/bin/bundle2.4 --version
Bundler version 1.16.1

2) If I modify bootstrap.sh to use rubygems version 2.7.4 instead of the latest (gem update --system 2.7.4 -N >/dev/null 2>&1) I am able to access bundle as expected.

3) If I add export DONT_USE_BUNDLER_FOR_GEMDEPS=1 to the bootstrap script (prior to the gem update and gem install), I am able to access bundle as expected. However, support for this environment variable was added in rubygems 2.7.5, and the standard behavior prior to this version was for this to be set to false, so I would not expect to need to set this variable.

At this point I am unsure if the bootstrap script should be modified or if this points to an issue with rubygems.

yahonda commented 6 years ago

Similar issue has been opened at RubyGems https://github.com/rubygems/rubygems/issues/2180

yahonda commented 6 years ago

I also reproduced it. I'd like to see how rubygems/rubygems#2180 goes. In the meantime, opening a pull request to rails-dev-box to lock RubyGems version to 2.7.4 by updating bootstrap.sh would be appreciated, I think.

fxn commented 6 years ago

Provisioning now installs Ruby 2.5 and does not upgrade RubyGems, which is 2.7.3.

Thanks for investigating this!