1

我有一个无法修复的红宝石错误。简而言之,红宝石不能正常工作。当我尝试重新安装它时

rvm reinstall all --force

我在终端中收到错误,说我应该看看 .log 文件。这是 .log 文件的内容:

[2013-07-26 18:51:22] __rvm_with
Restoring gems to pristine condition...
bigdecimal-1.2.0 ERROR:  Loading command: pristine (LoadError)
    cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
io-console-0.4.2 ERROR:  Loading command: pristine (LoadError)
    cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
json-1.7.7 ERROR:  Loading command: pristine (LoadError)
    cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
minitest-4.3.2 ERROR:  Loading command: pristine (LoadError)
    cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
psych-2.0.0 ERROR:  Loading command: pristine (LoadError)
    cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
rake-0.9.6 ERROR:  Loading command: pristine (LoadError)
    cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
rdoc-4.0.0 ERROR:  Loading command: pristine (LoadError)
    cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
test-unit-2.0.0.0 ERROR:  Loading command: pristine (LoadError)
    cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

'gem pristine bigdecimal --version 1.2.0 io-console --version 0.4.2 json --version 1.7.7 minitest --version 4.3.2 psych --version 2.0.0 rake --version 0.9.6 rdoc --version 4.0.0 test-unit --version 2.0.0.0' failed, you need to fix this gems manually.

我认为安装新的 xcode 预览版后出现错误,但我不确定它与此有关。

我在使用 10.8.4 山狮的 Mac 上。

有人知道如何解决这个问题吗?谢谢!

更新:

重新安装ssl并输入rvm reinstall命令后,日志文件再次出现错误:

[2013-07-26 19:21:48] /Users/User/.rvm/rubies/ruby-2.0.0-p0/bin/ruby
Exception `LoadError' at /Users/User/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rubygems.rb:1073 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /Users/User/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rubygems.rb:1082 - cannot load such file -- rubygems/defaults/ruby
Error loading RubyGems plugin "/Users/User/.rvm/gems/ruby-2.0.0-p0@global/gems/rubygems-bundler-1.2.0/lib/rubygems_plugin.rb": cannot load such file -- openssl (LoadError)
/Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security.rb:355: warning: already initialized constant Gem::Security::DIGEST_ALGORITHM
/Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security.rb:355: warning: previous definition of DIGEST_ALGORITHM was here
/Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security.rb:360: warning: already initialized constant Gem::Security::DIGEST_NAME
/Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security.rb:360: warning: previous definition of DIGEST_NAME was here
/Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security.rb:365: warning: already initialized constant Gem::Security::KEY_ALGORITHM
/Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security.rb:365: warning: previous definition of KEY_ALGORITHM was here
/Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security.rb:370: warning: already initialized constant Gem::Security::KEY_LENGTH
/Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security.rb:370: warning: previous definition of KEY_LENGTH was here
/Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security.rb:375: warning: already initialized constant Gem::Security::ONE_YEAR
/Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security.rb:375: warning: previous definition of ONE_YEAR was here
/Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security.rb:385: warning: already initialized constant Gem::Security::EXTENSIONS
/Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security.rb:385: warning: previous definition of EXTENSIONS was here
/Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/core_ext/kernel_require.rb:112:in `require': cannot load such file -- openssl (LoadError)
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/core_ext/kernel_require.rb:112:in `require'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security/policy.rb:23:in `initialize'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security/policies.rb:6:in `new'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security/policies.rb:6:in `<module:Security>'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security/policies.rb:1:in `<top (required)>'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/core_ext/kernel_require.rb:112:in `require'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/core_ext/kernel_require.rb:112:in `require'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/security.rb:583:in `<top (required)>'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/core_ext/kernel_require.rb:112:in `require'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/core_ext/kernel_require.rb:112:in `require'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/package.rb:43:in `<top (required)>'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/core_ext/kernel_require.rb:112:in `require'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/core_ext/kernel_require.rb:112:in `require'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/installer.rb:8:in `<top (required)>'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/core_ext/kernel_require.rb:112:in `require'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/core_ext/kernel_require.rb:112:in `require'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/request_set.rb:5:in `<top (required)>'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems.rb:200:in `finish_resolve'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/rdoc.rb:14:in `<top (required)>'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/core_ext/kernel_require.rb:51:in `require'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/core_ext/kernel_require.rb:51:in `require'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/uninstaller.rb:10:in `<top (required)>'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/core_ext/kernel_require.rb:51:in `require'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/core_ext/kernel_require.rb:51:in `require'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/commands/setup_command.rb:474:in `uninstall_old_gemcutter'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/commands/setup_command.rb:146:in `execute'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/command.rb:305:in `invoke_with_build_args'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/command_manager.rb:170:in `process_args'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/command_manager.rb:130:in `run'
    from /Users/User/.rvm/src/rubygems-2.0.6/lib/rubygems/gem_runner.rb:60:in `run'
    from setup.rb:45:in `<main>'
RubyGems 2.0.6 installed
4

1 回答 1

6

在终端中依次运行这些命令,然后关闭所有并打开新终端

rvm get stable
rvm autolibs enable
rvm reinstall all --force
于 2013-07-26T17:34:22.917 回答