~/.gemrc support for bundle install #1009

Closed
toolmantim opened this Issue Feb 3, 2011 · 4 comments

Projects

None yet

5 participants

@toolmantim
Contributor

Summary

I can't get Bundler living happily with my side-by-side 1.8 and 1.9 install. Rubygems is just fine thanks to ~/.gemrc and --format-executable, but because bundler doesn't pick up any of the ~/.gemrc options bundle install ends up clobbering all my bin wrappers :(

Setup

Ruby 1.8 installed with --program-suffix=18, and Ruby 1.9.2 installed plain vanilla.

For rubygems I've specified gem: --format-executable in ~/.gemrc which means that all bin stubs that are generated by gem install match the corresponding ruby bin.

With this setup gem install bundler and gem18 install bundler generates bundle and bundle18 bin wrappers respectively, and everything lives happily side-by-side in my $PATH.

Problem

bundle install doesn't respect the ~/.gemrc settings because it calls Gem::Installer (which is oblivious to the gemrc), and you end up with unformatted executables, clobbering the other Ruby's bin wrappers of the same name :(

See the Gem::Installer options difference between Bundler and Rubygems:
https://github.com/carlhuda/bundler/blob/1-0-stable/lib/bundler/source.rb#L88
https://github.com/rubygems/rubygems/blob/master/lib/rubygems/dependency_installer.rb#L271

Solution?

I tried patching source.rb to use Gem::Command::Installer as opposed to Gem::Installer so the ~/.gemrc settings are picked up, but I couldn't get the tests to pass and wasn't sure whether it was supported rubygems API. Happy to get it working with tests if this is the way to go.

@drbrain
Contributor
drbrain commented Feb 3, 2011

The bundler installer should use Gem::ConfigFile to merge the settings from ~/.gemrc like gem install

@simi
Contributor
simi commented Jul 13, 2013

Doesn't d800773 solves this?

@xaviershay
Contributor

assume yes, this was 3 years ago.

@xaviershay xaviershay closed this Aug 10, 2013
@tcannonfodder

It looks like the original issue as of version 1.11.2. The --format-executable flag in the user or system gemrc files is not respected when bundler installs a binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment