GEM_PATH incorrectly includes system ruby? #259

Closed
flowchartsman opened this Issue Aug 31, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@flowchartsman

After following the instructions to install ruby 1.9.3-p194 on a shared linux host using both the ruby-build plugin and manually, I receive the following error when starting irb:

Invalid gemspec in [/usr/lib/ruby/gems/1.8/specifications/archive-tar-minitar-0.5.1.gemspec]

$GEM_HOME looks fine, but $GEM_PATH seems to include system ruby:

$ echo $GEM_HOME
/home/MY_USER/.gems

$ echo $GEM_PATH
/home/MY_USER/.gems:/usr/lib/ruby/gems/1.8

Seems like that might be the problem. Is this expected?

Setting $GEM_PATH equal to $GEM_HOME makes irb start without errors, though a 'gem install <gem_name>' issues the following warning:

It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.

@mislav

This comment has been minimized.

Show comment Hide comment
@mislav

mislav Dec 13, 2012

Member

Having GEM_HOME or GEM_PATH present at all times in your shell is a bad idea. It basically hardcodes your ruby, and doesn't play well if you switch rubies with a tool like rbenv.

Try to unset both environment variables, and set them only in situations when they are needed and you know exactly what you're doing.

Member

mislav commented Dec 13, 2012

Having GEM_HOME or GEM_PATH present at all times in your shell is a bad idea. It basically hardcodes your ruby, and doesn't play well if you switch rubies with a tool like rbenv.

Try to unset both environment variables, and set them only in situations when they are needed and you know exactly what you're doing.

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