通过RVM进行Ruby 2.0.0安装:openssl周围的错误


8

使用:Mountain Lion 10.8.2RVM 1.18.15

显然openssl尝试通过RVM安装Ruby 2.0.0时遇到了麻烦:

$ rvm install 2.0.0
...
Extracting openssl to /Users/meltemi/.rvm/src/openssl-1.0.1c
Configuring openssl in /Users/meltemi/.rvm/src/openssl-1.0.1c.
Error running './Configure darwin64-x86_64-cc -I/Users/meltemi/.rvm/usr/include -L/Users/meltemi/.rvm/usr/lib zlib no-asm no-krb5 --prefix=/Users/meltemi/.rvm/usr no-shared ', please read /Users/meltemi/.rvm/log/ruby-2.0.0-p0/openssl/configure.log
Compiling openssl in /Users/meltemi/.rvm/src/openssl-1.0.1c.
Error running 'make', please read /Users/meltemi/.rvm/log/ruby-2.0.0-p0/openssl/make.log

因此,我brew install openssl将openssl更新为1.0.1e希望有帮助,但仍有更多错误(请参见“长输出”)。

因此,在Stack Exchange上进行挖掘,然后松散地遵循了这篇帖子中的建议rvm get head(与我的典型相对rvm get stable),并注意到以下建议:

$ rvm get head
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
...
100 1620k  100 1620k    0     0   275k      0  0:00:05  0:00:05 --:--:--  479k

Upgrading the RVM installation in /Users/meltemi/.rvm/
    RVM PATH line found in /Users/meltemi/.bashrc /Users/meltemi/.zshrc.
    RVM sourcing line found in /Users/meltemi/.bash_profile /Users/meltemi/.zshrc.
    Installing rvm gem in 1 gemsets ERROR:  Loading command: install (LoadError)
    cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

有趣的是cannot load such file -- openssl

是什么赋予了?

长输出:

在通过自制软件将openssl升级到1.0.1.e之后,再次尝试,但是无论出于何种原因仍在引用1.0.1c:

$ rvm reinstall 2.0.0 --with-openssl-dir=/usr/local          
Removing /Users/meltemi/.rvm/src/ruby-2.0.0-p0...
Removing /Users/meltemi/.rvm/rubies/ruby-2.0.0-p0...
Fetching openssl-1.0.1c.tar.gz to /Users/meltemi/.rvm/archives
Extracting openssl to /Users/meltemi/.rvm/src/openssl-1.0.1c
Configuring openssl in /Users/meltemi/.rvm/src/openssl-1.0.1c.
Error running './Configure darwin64-x86_64-cc -I/Users/meltemi/.rvm/usr/include -L/Users/meltemi/.rvm/usr/lib zlib no-asm no-krb5 --prefix=/Users/meltemi/.rvm/usr --with-openssl-dir=/usr/local no-shared ', please read /Users/meltemi/.rvm/log/ruby-2.0.0-p0/openssl/configure.log
Compiling openssl in /Users/meltemi/.rvm/src/openssl-1.0.1c.
Error running 'make', please read /Users/meltemi/.rvm/log/ruby-2.0.0-p0/openssl/make.log

Please note that it's required to reinstall all rubies:

    rvm reinstall all --force

Updating openssl certificates
Error running 'update_openssl_certs', please read /Users/meltemi/.rvm/log/ruby-2.0.0-p0/openssl.certs.log
Installing Ruby from source to: /Users/meltemi/.rvm/rubies/ruby-2.0.0-p0, this may take a while depending on your cpu(s)...
ruby-2.0.0-p0 - #downloading ruby-2.0.0-p0, this may take a while depending on your connection...
ruby-2.0.0-p0 - #extracting ruby-2.0.0-p0 to /Users/meltemi/.rvm/src/ruby-2.0.0-p0
ruby-2.0.0-p0 - #extracted to /Users/meltemi/.rvm/src/ruby-2.0.0-p0
ruby-2.0.0-p0 - #configuring
ruby-2.0.0-p0 - #compiling
ruby-2.0.0-p0 - #installing 
Removing old Rubygems files...
Installing rubygems-2.0.0 for ruby-2.0.0-p0 ...
Error running 'env GEM_PATH=/Users/meltemi/.rvm/gems/ruby-2.0.0-p0:/Users/meltemi/.rvm/gems/ruby-2.0.0-p0@global:/Users/meltemi/.rvm/gems/ruby-2.0.0-p0:/Users/meltemi/.rvm/gems/ruby-2.0.0-p0@global GEM_HOME=/Users/meltemi/.rvm/gems/ruby-2.0.0-p0 /Users/meltemi/.rvm/rubies/ruby-2.0.0-p0/bin/ruby /Users/meltemi/.rvm/src/rubygems-2.0.0/setup.rb', please read /Users/meltemi/.rvm/log/ruby-2.0.0-p0/rubygems.install.log
Installation of rubygems did not complete successfully.
Saving wrappers to '/Users/meltemi/.rvm/bin'.
ruby-2.0.0-p0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-2.0.0-p0 - #importing default gemsets, this may take time ...
Install of ruby-2.0.0-p0 - #complete 
Making gemset ruby-2.0.0-p0 pristine.
Error running '' under ,
please read /Users/meltemi/.rvm/log/ruby-2.0.0-p0/gemset.pristine.log
Making gemset ruby-2.0.0-p0@global pristine.
Error running '' under ,
please read /Users/meltemi/.rvm/log/ruby-2.0.0-p0/gemset.pristine.log

升级到OSX Mavericks后,我遇到了同样的问题。
横街

Answers:


16

有同样的问题。请尝试以下操作:

$ rvm remove 2.0.0 # get rid of unsuccessful installation
$ rvm get head --autolibs=3 # get the latest RVM and build required libs
$ rvm requirements # just in case, install all other required stuff
$ rvm install ruby-2.0.0
$ rvm --default use ruby-2.0.0

--autolibs=3旗到底是做什么的?我找不到任何文档……
Meltemi

FWIW-我按照您的指示进行了以下操作:remove 2.0.0然后rvm get head(忽略该--autolibs=3位)。检查要求。好。然后rvm install ruby-2.0.0。而且...没有问题!有效!
Meltemi

github.com/wayneeseguin/rvm/issues/1623autolibs据我了解,标志上有一些信息,它告诉RVM如何处理其他必需的库。
阿尔乔姆Pakk

可以通过运行以下cmd找到自动库的文档:从终端运行
Jeremy Cade

在OSX 10.8下:还sudo brew install openssl
idonnie 2013年

0

所以这对我有用:

rvm pkg install openssl
rvm reinstall all --force

我也有rvm autolibs rvm_pkgreadline支持。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.