无法加载此类文件 — ruby​​gems.rb [英] cannot load such file — rubygems.rb

查看:81
本文介绍了无法加载此类文件 — ruby​​gems.rb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要打开这个项目(狂欢),我需要使用 ruby​​-2.1.2.我已经安装了 ruby​​-2.1.0 和 ruby​​-2.1.2,但我认为 2.1.2 版本由于某种原因已损坏,我似乎无法使用它.

To open this project (revel) I need to be using ruby-2.1.2. I have both ruby-2.1.0 and ruby-2.1.2 installed, but I think the 2.1.2 version is corrupt for some reason and I can't seem to use it.

|~/desktop/ix/projects/revel> rvm use 2.1.2
Using /Users/lianoosh/.rvm/gems/ruby-2.1.2
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)
    from <internal:gem_prelude>:1:in `<compiled>'

|~/desktop/ix/projects/revel> gem list
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)
    from <internal:gem_prelude>:1:in `<compiled>'

|~/desktop/ix/projects/revel> gem update --system 
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)
    from <internal:gem_prelude>:1:in `<compiled>'

当我尝试卸载以重新安装时,我得到:

When I tried to uninstall to reinstall I get:

|~/desktop/ix/projects/revel> rvm uninstall 2.1.2
ruby-2.1.2 - #removing rubies/ruby-2.1.2............................................................................................................................|
Error running '__rvm_rm_rf /Users/lianoosh/.rvm/rubies/ruby-2.1.2',
showing last 15 lines of /Users/lianoosh/.rvm/log/1408110977_ruby-2.1.2/remove.rubies.log
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/tzinfo-1.2.1/test/zoneinfo: Permission denied
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/tzinfo-1.2.1/test: Permission denied
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/tzinfo-1.2.1/tzinfo.gemspec: Permission denied
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/tzinfo-1.2.1: Directory not empty
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems: Directory not empty
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0: Directory not empty
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby/gems: Directory not empty
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib/ruby: Directory not empty
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2/lib: Directory not empty
rm: /Users/lianoosh/.rvm/rubies/ruby-2.1.2: Directory not empty
++ typeset ret=1
++ rvm_debug '__rvm_rm_rf error removing target dir '\''/Users/lianoosh/.rvm/rubies/ruby-2.1.2'\''.'
++ ((  0  ))
++ return 0
++ return 1

那么:

|~/desktop/ix/projects/revel> rvm list

rvm rubies

   ruby-2.1.0 [ x86_64 ]
=* ruby-2.1.2 [ missing bin/ruby ]

# => - current
# =* - current && default
#  * - default

所以当我尝试重新安装时,我得到:

So when I try to reinstall I get:

Already installed ruby-2.1.2.
To reinstall use:

    rvm reinstall ruby-2.1.2

当我这样做时,我收到一堆权限被拒绝的消息,并且目录不是空的,然后回到我开始的地方.还有:

And when I do that I get a bunch of permission denied messages and directory not empty and go right back to where I started. Also:

Empty path passed to certificates update, functions stack: requirements_osx_update_openssl_cert_run rvm_requiremnts_fail_or_run_action __rvm_osx_ssl_certs_ensure_for_ruby __rvm_osx_ssl_certs_ensure_for_ruby_except_jruby external_import_setup external_import main

请帮忙!

推荐答案

试试这个:

rvm fix-permissions

rvm reinstall 2.1.2

这篇关于无法加载此类文件 — ruby​​gems.rb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆