在osx 10.9.3上使用RVM安装ruby-1.9.3-p547时出错

时间:2014-07-01 04:04:28

标签: ruby-on-rails ruby macos rvm

如何解决此错误:

$ rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.9/x86_64/ruby-1.9.3-p547.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Warning: DYLD_LIBRARY_PATH environment variable is set, this might interact with the compilation and ruby.
Installing Ruby from source to: /Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p547, this may take a while depending on your cpu(s)...
ruby-1.9.3-p547 - #downloading ruby-1.9.3-p547, this may take a while depending on your connection...
ruby-1.9.3-p547 - #extracting ruby-1.9.3-p547 to /Users/TomCaflisch/.rvm/src/ruby-1.9.3-p547...
ruby-1.9.3-p547 - #applying patch /Users/TomCaflisch/.rvm/patches/ruby/GH-488.patch.
ruby-1.9.3-p547 - #configuring.
Error running './configure --prefix=/Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p547 --with-opt-dir=/usr/local/Cellar/libyaml/0.1.4:/usr/local/Cellar/readline/6.2.4:/usr/local/Cellar/libksba/1.3.0:/usr/local/Cellar/openssl/1.0.1e --without-tcl --without-tk --disable-install-doc --enable-shared',
showing last 15 lines of /Users/TomCaflisch/.rvm/log/1404187306_ruby-1.9.3-p547/configure.log
[2014-06-30 23:01:50] ./configure
current path: /Users/TomCaflisch/.rvm/src/ruby-1.9.3-p547
GEM_HOME=/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327
PATH=/Users/TomCaflisch/.rvm/usr/bin:/usr/local/Cellar/pkg-config/0.28/bin:/usr/local/Cellar/libtool/2.4.2/bin:/usr/local/Cellar/automake/1.14/bin:/usr/local/Cellar/autoconf/2.69/bin:/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327/bin:/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327@global/bin:/Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p327/bin:/Users/TomCaflisch/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/mysql/bin
GEM_PATH=/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327:/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p327@global
command(7): ./configure --prefix=/Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p547 --with-opt-dir=/usr/local/Cellar/libyaml/0.1.4:/usr/local/Cellar/readline/6.2.4:/usr/local/Cellar/libksba/1.3.0:/usr/local/Cellar/openssl/1.0.1e --without-tcl --without-tk --disable-install-doc --enable-shared
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... x86_64-apple-darwin13.2.0
checking host system type... x86_64-apple-darwin13.2.0
checking target system type... x86_64-apple-darwin13.2.0
checking whether the C compiler works... no
configure: error: in `/Users/TomCaflisch/.rvm/src/ruby-1.9.3-p547':
configure: error: C compiler cannot create executables
See `config.log' for more details
There has been an error while running configure. Halting the installation.

我现在正在摇晃osx 10.9.4。

当我$ rvm get latest时,我收到此错误:

$ rvm get latest
Downloading https://get.rvm.io
Downloading https://github.com/wayneeseguin/rvm/archive/1.25.28.tar.gz

Upgrading the RVM installation in /Users/TomCaflisch/.rvm/
    RVM PATH line found in /Users/TomCaflisch/.bashrc /Users/TomCaflisch/.zshrc.
    RVM sourcing line found in /Users/TomCaflisch/.bash_profile /Users/TomCaflisch/.zprofile.
    Installing gem-wrappers gem in 4 gemsetsError running 'gem install gem-wrappers -v >=1.2.4 --no-ri --no-rdoc',
showing last 15 lines of /Users/TomCaflisch/.rvm/log/1405391557_ruby-1.9.3-p484/gem.install.gem-wrappers->=1.2.4.log
PATH=/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p484@global/bin:/Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/bin:/Users/TomCaflisch/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/mysql/bin
GEM_PATH=/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p484@global
command(7): gem install gem-wrappers -v >=1.2.4 --no-ri --no-rdoc
Error loading RubyGems plugin "/Users/TomCaflisch/.rvm/gems/ruby-1.9.3-p484@global/gems/executable-hooks-1.2.6/lib/rubygems_plugin.rb": dlopen(/Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/x86_64-darwin12.5.0/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/x86_64-darwin12.5.0/openssl.bundle
  Reason: image not found - /Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/x86_64-darwin12.5.0/openssl.bundle (LoadError)
/Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/yaml.rb:84:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
ERROR:  Loading command: install (LoadError)
        dlopen(/Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/x86_64-darwin12.5.0/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/x86_64-darwin12.5.0/openssl.bundle
  Reason: image not found - /Users/TomCaflisch/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/x86_64-darwin12.5.0/openssl.bundle
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
Error running 'gem install gem-wrappers -v >=1.2.4 --no-ri --no-rdoc',
showing last 15 lines of /Users/TomCaflisch/.rvm/log/1405391559_ruby-2.0.0-p247/gem.install.gem-wrappers->=1.2.4.log
  Reason: image not found - /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.4.0/psych.bundle
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:1:in `<top (required)>'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/yaml.rb:5:in `<top (required)>'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems.rb:659:in `load_yaml'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:327:in `load_file'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:196:in `initialize'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:74:in `new'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:74:in `do_configuration'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:39:in `run'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.0.0-p247/bin/gem:21:in `<main>'
Error running 'gem install gem-wrappers -v >=1.2.4 --no-ri --no-rdoc',
showing last 15 lines of /Users/TomCaflisch/.rvm/log/1405391560_ruby-2.1.0-preview1/gem.install.gem-wrappers->=1.2.4.log
  Reason: image not found - /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/x86_64-darwin12.5.0/psych.bundle
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:53:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/psych.rb:1:in `<top (required)>'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:53:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:53:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/yaml.rb:5:in `<top (required)>'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:53:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:53:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems.rb:659:in `load_yaml'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/config_file.rb:326:in `load_file'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/config_file.rb:195:in `initialize'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/gem_runner.rb:74:in `new'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/gem_runner.rb:74:in `do_configuration'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/lib/ruby/2.1.0/rubygems/gem_runner.rb:39:in `run'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview1/bin/gem:21:in `<main>'
Error running 'gem install gem-wrappers -v >=1.2.4 --no-ri --no-rdoc',
showing last 15 lines of /Users/TomCaflisch/.rvm/log/1405391560_ruby-2.1.0-preview2/gem.install.gem-wrappers->=1.2.4.log
  Reason: image not found - /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/2.1.0/x86_64-darwin12.0/psych.bundle
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/2.1.0/psych.rb:1:in `<top (required)>'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/2.1.0/yaml.rb:5:in `<top (required)>'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems.rb:659:in `load_yaml'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/config_file.rb:327:in `load_file'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/config_file.rb:196:in `initialize'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/gem_runner.rb:74:in `new'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/gem_runner.rb:74:in `do_configuration'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/lib/ruby/site_ruby/2.1.0/rubygems/gem_runner.rb:39:in `run'
        from /Users/TomCaflisch/.rvm/rubies/ruby-2.1.0-preview2/bin/gem:21:in `<main>'
.
Upgrade of RVM in /Users/TomCaflisch/.rvm/ is complete.

# Tom Caflisch,
#
#   Thank you for using RVM!
#   We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.

In case of problems: http://rvm.io/help and https://twitter.com/rvm_io

Upgrade Notes:

  * No new notes to display.

RVM reloaded!

3 个答案:

答案 0 :(得分:9)

遇到了同样的问题。只是运行这些命令将所有内容排序......

$ xcode-select --install - 这似乎是关键。

$ rvm cleanup all - 可能需要在此版本上运行sudo

$ rvm get latest

$ rvm install ruby-1.9.3 - 无论有什么补丁。

希望这适合你!

答案 1 :(得分:3)

看起来你错过了Xcode命令行工具。

尝试运行

xcode-select --install

然后运行

gcc --version

查看是否安装了GCC或LLVM。如果是,您可以尝试再次通过RVM安装ruby。

答案 2 :(得分:2)

我有同样的问题。对我来说,这解决了这个问题:

启动Xcode。当它为我推出时,它要求获得完成下载和安装一些东西的许可(抱歉,我不记得确切的消息,或者它是否甚至列出了这些项目)。我同意并等待它完成下载/安装。

我再次尝试rvm install 1.9.3并且有效。 rvm get latest现在也可以毫无问题地工作。