Ubuntu的rvm ruby和openssl

3

我正在尝试在Ubuntu上使用rvm安装ruby。我使用synaptic包管理器安装了rvm。

$ which rvm
/usr/bin/rvm
$ rvm --version

rvm 1.6.9 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]

我尝试安装Ruby:

$ rvm install 1.9.2
...
ERROR: Error running 'make ', please read /usr/share/ruby-rvm/log/ruby-1.9.2-p180/make.log
ERROR: There has been an error while running make. Halting the installation.

日志文件中的问题与openssl有关:

ossl_ssl.c:110:1: error: ‘SSLv2_method’ undeclared here (not in a function)

https://rvm.io/packages/openssl/ 上建议执行 $ rvm requirements 命令,但是会出现错误:
$ rvm requirements
ERROR: Unrecognized command line argument: 'requirements' ( see: 'rvm usage' )

在同一页面上,它要求执行$ rvm reinstall 1.9.2 --with-openssl-dir=/usr/local,但这在编译Ruby期间仍然会给我相同的错误。第二种方法是在同一页面上,执行rvm pkg install openssl

$ rvm pkg install openssl
ERROR: Unrecognized command line argument: 'pkg' ( see: 'rvm usage' )

看起来已经安装了 OpenSSL:

$ dpkg --get-selections | grep openssl
openssl                     install
python-openssl              install

1
不要使用软件包管理器安装rvm,而是使用提供的安装脚本。请参考http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/上的教程进行操作。 - sevenseacat
2个回答

4
您正在使用过时的RVM版本。您应该采用推荐的安装路径,该路径在http://rvm.io上有详细说明,不要使用软件包安装程序。要解决此问题,请查看此说明https://dev59.com/D2ox5IYBdhLWcg3wqmBt#9056395
此外,请勿使用1.9.2版本,而应使用当前的1.9.3 ruby版本,对于新项目,请使用即将推出的RC1版本2.0.0。

1
如果您使用Ubuntu操作系统,只需从此PPA中获取Ruby即可。
http://blog.brightbox.co.uk/posts/next-generation-ruby-packages-for-ubuntu

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接