Rishi
Rishi

Reputation: 935

Issue with rubygems.rb when installing Rails

I recently had to delete all my versions in Ruby and reinstall them. After doing so (I'm now using 2.0.0 if that's relevant) I cannot reinstall rails. This was all done with RVM.

Here is the error :1:in require': cannot load such file -- rubygems.rb (LoadError) from <internal:gem_prelude>:1:in'

Update: I tried reinstalling RVM, as Albert suggested. I still receive the same error message.

when I run which -a ruby

/Users/bob/.rvm/rubies/ruby-2.0.0-p353/bin/ruby
/usr/bin/ruby

when I run rvm remove 2.0.0

Error running '__rvm_rm_rf /Users/bob/.rvm/rubies/ruby-2.0.0-p353',
showing last 15 lines of /Users/bob/.rvm/log/1389478324_ruby-2.0.0-
p353/remove.rubies.logrm: /Users/bob/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/gems/2.0.0/gems/tzinfo-0.3.38/test/tc_timezone_offset_info.rb: Permission denied
rm: /Users/bob/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/gems/2.0.0/gems/tzinfo-0.3.38/test/tc_timezone_period.rb: Permission denied
rm: /Users/bob/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/gems/2.0.0/gems/tzinfo-0.3.38/test/tc_timezone_proxy.rb: Permission denied
rm: /Users/bob/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/gems/2.0.0/gems/tzinfo-0.3.38/test/tc_timezone_transition_info.rb: Permission denied
rm: /Users/bob/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/gems/2.0.0/gems/tzinfo-0.3.38/test/tc_timezone_utc.rb: Permission denied
rm: /Users/bob/rvm/rubies/ruby-2.0.0-p353/lib/ruby/gems/2.0.0/gems/tzinfo-0.3.38/test/test_utils.rb: Permission denied
rm: /Users/bob/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/gems/2.0.0/gems/tzinfo-0.3.38/test/ts_all.rb: Permission denied
rm: /Users/bob/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/gems/2.0.0/gems/tzinfo-0.3.38/test: Permission denied
rm: /Users/bob/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/gems/2.0.0/gems/tzinfo-0.3.38: Directory not empty
rm: /Users/bob/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/gems/2.0.0/gems: Directory not empty
rm: /Users/bob/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/gems/2.0.0: Directory not empty
rm: /Users/bob/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/gems: Directory not empty
rm: /Users/bob/.rvm/rubies/ruby-2.0.0-p353/lib/ruby: Directory not empty
rm: /Users/bob/.rvm/rubies/ruby-2.0.0-p353/lib: Directory not empty
rm: /Users/bob/.rvm/rubies/ruby-2.0.0-p353: Directory not empty

Upvotes: 3

Views: 697

Answers (1)

mpapis
mpapis

Reputation: 53158

It is a problem because of using sudo (you should not run sudo), to fix it run:

rvm fix-permissions

you should be now able to:

rvm reinstall 2.0.0

it will reinstall your ruby, ensure everything is set up properly and that your gems are usable with then new ruby.

Upvotes: 13

Related Questions