Rubygems path bug with Ruby 1.9.0

If you ever encounter an error like the one below, it's because 

gem_prelude.rb:114:in `push_gem_version_on_load_path': undefined method `<=>' for nil:NilClass (NoMethodError)
        from gem_prelude.rb:8:in `gem'
        from /usr/bin/haml:18:in `<main>'

 

It's some bug. So do this to solve it. Preferbly add it to your .profile

export GEM_HOME=/usr/lib/ruby1.9/gems/1.9.0

export GEM_PATH=$GEM_HOME:/home/singalong/.gem/ruby/1.9.0

When you use ruby 1.8, unset both GEM_HOME and GEM_PATH

Filed under  //   bug   ruby   rubygems  

Comments (1)

Apr 26, 2010
 said...
It was so helpful, I've been searching about this for hours.

Thank you!

Leave a comment...

About

Web developer and tech enthusiast from Bangalore. I love working on the secret-sauce backend of applications.

TwitterTwitterFlickr