我最近不得不删除Ruby中的所有版本并重新安装它们。这样做之后(我现在使用的是2.0.0,如果相关的话)我无法重新安装rails。这一切都是用RVM完成的。
这是错误
:1:在require': cannot load such file -- rubygems.rb (LoadError)
from <internal:gem_prelude>:1:in
&#39;
更新:我尝试重新安装RVM,正如Albert建议的那样。我仍然收到相同的错误消息。
当我运行which -a ruby
/Users/bob/.rvm/rubies/ruby-2.0.0-p353/bin/ruby
/usr/bin/ruby
当我运行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
答案 0 :(得分:13)
这是一个问题,因为使用sudo
(你不应该运行sudo
),修复它运行:
rvm fix-permissions
你现在应该能够:
rvm reinstall 2.0.0
它将重新安装你的红宝石,确保所有东西都正确设置,你的宝石可用于新的红宝石。