Cannot Load Such File - Rubygems.Rb

cannot load such file — rubygems.rb

Try this:

rvm fix-permissions

rvm reinstall 2.1.2

cannot load such file -- rubygems.rb (LoadError)

It seems that the rspec binary was only installed for your previous ruby version. Therefore it is found, but not guaranteed to work.

I'd recommend to use something like rvm (https://rvm.io/) or rbenv (https://github.com/rbenv/rbenv). Both of them can easily handle different ruby versions while maintaining dependencies (e.g. different load paths, different gem versions, etc.). I'd even use rvm if there is only one single ruby version installed on a system.

cannot load such file -- rubygems.rb

I would recommend uninstalling ruby-2.1.0 and then reinstalling it as it seems like your current installation is corrupted.

rvm uninstall 2.1.0
rvm install 2.1.0

`require': cannot load such file -- rubygems.rb when installing ruby and rubygems with rvm

It turns out that my problem was the fact that I had created a symbolic link to gem manually in /usr/bin. After deleting the symbolic link, I reinstalled everything using the following commands:

rvm implode
\curl -L https://get.rvm.io | bash -s stable --ruby
source /home/<username>/.rvm/scripts/rvm

after which

gem install rails

worked like a charm.

no such file to load -- rubygems (LoadError)

I have a hunch that you have two ruby versions. Please paste the output of following command:

$ which -a ruby

updated regarding to the comment:

Nuke one version and leave only one. I had same problem with two versions looking at different locations for gems. Had me going crazy for few weeks. Put up a bounty here at SO got me same answer I'm giving to you.

All I did was nuke one installation of ruby and left the one managable via ports. I'd suggest doing this:

  1. Remove ruby version installed via ports (yum or whatever package manager).
  2. Remove ruby version that came with OS (hardcore rm by hand).
  3. Install ruby version from ports with different prefix (/usr instead of /usr/local)
  4. Reinstall rubygems

cannot load such file -- rubygems/defaults/ruby error?

If you're loading in a YAML file that has frozen classes that aren't defined you'll have to load those prior to deserializing this file.

I don't know what you'll encounter, it just runs until it stumbles over the first thing, but if you need DateTime then require 'date' might fix that. Whatever class is missing you need to do the same thing, track down where it's defined and require it prior to the YAML.load part.



Related Topics



Leave a reply



Submit