Skip to content
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

Preview and RC versions use shared sets of gems #327

Open
schneems opened this issue Dec 6, 2018 · 1 comment
Open

Preview and RC versions use shared sets of gems #327

schneems opened this issue Dec 6, 2018 · 1 comment

Comments

@schneems
Copy link

schneems commented Dec 6, 2018

I had preview3 installed and then I installed rc1 via ruby-install. Once I did I got these errors:

$ chruby 2.6.0
β›„ 2.6.0 πŸš€  /tmp
$ ruby -v
ruby 2.6.0rc1 (2018-12-06 trunk 66253) [x86_64-darwin17]
β›„ 2.6.0 πŸš€  /tmp
$ which bundle
/Users/rschneeman/.gem/ruby/2.6.0/bin/bundle
β›„ 2.6.0 πŸš€  /tmp
$ bundle -v
Traceback (most recent call last):
	2: from /Users/rschneeman/.gem/ruby/2.6.0/bin/bundle:23:in `<main>'
	1: from /Users/rschneeman/.rubies/ruby-2.6.0-preview3/lib/ruby/2.6.0/rubygems.rb:307:in `activate_bin_path'
/Users/rschneeman/.rubies/ruby-2.6.0-preview3/lib/ruby/2.6.0/rubygems.rb:288:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
β›„ 2.6.0 πŸš€  /tmp
$ bundle --help
Traceback (most recent call last):
	2: from /Users/rschneeman/.gem/ruby/2.6.0/bin/bundle:23:in `<main>'
	1: from /Users/rschneeman/.rubies/ruby-2.6.0-preview3/lib/ruby/2.6.0/rubygems.rb:307:in `activate_bin_path'
/Users/rschneeman/.rubies/ruby-2.6.0-preview3/lib/ruby/2.6.0/rubygems.rb:288:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)

Notice that it's trying to use /Users/rschneeman/.rubies/ruby-2.6.0-preview3. It turns out that's because even though I deleted /Users/rschneeman/.rubies/ruby-2.6.0-preview3 the gems are still installed at /Users/rschneeman/.rubies/ruby-2.6.0. There was a hardcoded shebang line in that directory which was causing the issue.

@havenwood
Copy link
Collaborator

There's a RubyGems issue ticket open for using --env-shebang if File.dirname(Gem.ruby) is in $PATH. Here's a chruby issue that discusses a proposal for intentionally sharing gems between Rubies of the same ABI, which is a related issue.

I'd personally suggest setting --env-shebang in gemrc until RubyGems adopts it as a default. (JRuby does already default to --env-shebang.)

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

2 participants