When I run the gem command, I get the following error message:
ruby: No such file to load – rubygems (LoadError)
What’s wrong?
Answer
It looks like executing copy of Ruby does not have the RubyGems library
installed. RubyGems was probably installed at one time (because the gem
command is recognized), but it may have been installed on a different
installation of Ruby than the one you are currently running.
Things to check
* Check that the installation of Ruby that is running is the same
one that has RubyGems installed. On a unix system, the which command (or
type command) will help figure this out.
* Verify that the currently running installation of Ruby does indeed
have the RubyGems library installed. You should find a “rubygems.rbâ€
file in the site_ruby/1.8 directory of the Ruby installation.
These mixup can easily happen after installing a new instance of Ruby,
but the old instance preceeds the new one in the PATH list.
ruby 1.8.6 (2007-09-24 patchlevel 111) [universal-darwin9.0]
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in gem_original_require': no such file to load -- rails (LoadError) from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:inrequire’
from -e:1
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.