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

When GEM_HOME is set to an empty value, GEM_PATH get's built wrong. #133

Closed
amerine opened this issue Feb 24, 2010 · 7 comments

Comments

Projects
None yet
3 participants
@amerine
Copy link

commented Feb 24, 2010

An empty GEM_HOME should not be used to generate the GEM_PATH. When bundler creates the path it creates an invalid GEM_PATH=":/Users/User/.gem/ruby/1.8:/opt/local/lib/ruby/gems/1.8:". It should not have that leading ':'

Aridious on IRC suggests the issue lies in Bundler#configure_gem_home_and_path

@skippy

This comment has been minimized.

Copy link

commented Feb 24, 2010

I couldn't quite track it down, as to who was setting GEM_HOME incorrectly (rvm? rubygem update --system?).

in Bundler#configure_gem_home_and_path ln 122, the array [gem_home, gem_path] looked like this:
["", ["/Users/Adam/.gem/ruby/1.8", "/opt/local/lib/ruby/gems/1.8", ""]]

if the code is switched to:
[gem_home, gem_path].flatten.compact.delete_if{|v| v.strip.empty?}

you're set.

it is ugly; perhaps scrubbing elsewhere is more appropriate (so another error like this doesn't show up somewhere else).

thanks
btw, skippy == aridious

@amerine

This comment has been minimized.

Copy link
Author

commented Feb 24, 2010

It's RVM setting incorrectly. Edit: I shouldn't say "incorrectly" but it would seem that RVM sets it to blank if it was blank before. A simple rvm reset seems to fix it, but a fix in bundler to handle a blank env variable makes sense.

@indirect

This comment has been minimized.

Copy link
Member

commented Feb 25, 2010

Hey guys. Unfortunately, I haven't been able to reproduce this after trying a couple of times. Can someone give me steps to reproduce (or better yet write a failing test)? Thanks.

@amerine

This comment has been minimized.

Copy link
Author

commented Feb 25, 2010

Sure thing. Here is a sample session where I set GEM_HOME to an empty value and it reproduces the error. https://gist.github.com/8f0f830f7b5a65190120

@skippy

This comment has been minimized.

Copy link

commented Feb 25, 2010

Same happens in Rails 2.3.5 (so it isn't a Rails 3.0 beta thing).

@indirect

This comment has been minimized.

Copy link
Member

commented Feb 25, 2010

Thank you, that helped nail down the exact point of breakage. This is fixed in 55509f2, and will be part of the next release.

@amerine

This comment has been minimized.

Copy link
Author

commented Feb 25, 2010

Excellent!

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.