Platinum Partner

How To Avoid The Ubygems Load Error

If you install Ruby & RubyGems from scratch (like described here or here), beginning with:


sudo mv /usr/local/lib/ruby ~/Desktop


and at some point have to execute the command:


sudo /usr/local/bin/ruby setup.rb


... you may see an error message that says:


/usr/local/bin/ruby: no such file to load -- ubygems (LoadError)


This can be avoided by setting the RUBYLIB path variable to include the lib directory of the downloaded RubyGems version:


unset RUBYOPT
export GEM_HOME=/usr/local/lib/ruby/gems/1.8
export RUBYLIB=/usr/local/lib/ruby:/path/to/download/dir/rubygems-1.3.1/lib

sudo /usr/local/bin/ruby setup.rb


or


sudo mkdir -p /usr/local/lib/ruby/gems/1.8
sudo mkdir -p /usr/local/lib/ruby/site_ruby/1.8
unset RUBYOPT
export GEM_HOME=/usr/local/lib/ruby/gems/1.8
export RUBYLIB=/usr/local/lib/ruby:/usr/local/lib/ruby/site_ruby/1.8
sudo cp -R -p /path/to/download/dir/rubygems-1.3.1/lib/* /usr/local/lib/ruby/site_ruby/1.8

sudo /usr/local/bin/ruby setup.rb

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}