OpenSSL错误在Mac上使用rbenv安装ruby 2.0.0-p195 [英] OpenSSL error installing ruby 2.0.0-p195 on Mac with rbenv
问题描述
我试图在Mac(Mountain Lion)上使用rbenv安装Ruby 2.0.0-p195,但出现此错误.
I'm trying to install Ruby 2.0.0-p195 using rbenv on a Mac (Mountain Lion) and got this error.
BUILD FAILED
Inspect or clean up the working tree at /var/folders/vt/27n8h2yj27v7rzq58075f3_m0000gn/T/ruby-build.20130618163859.1669
Results logged to /var/folders/vt/27n8h2yj27v7rzq58075f3_m0000gn/T/ruby-build.20130618163859.1669.log
Last 10 log lines:
installing default gems: /Users/me/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0 (build_info, cache, doc, gems, specifications)
bigdecimal 1.2.0
io-console 0.4.2
json 1.7.7
minitest 4.3.2
psych 2.0.0
rake 0.9.6
rdoc 4.0.0
test-unit 2.0.0.0
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?
当我运行brew install openssl时说
When I ran brew install openssl it said
Warning: openssl-1.0.1e already installed
在此线程上遵循解决方案 https://github.com/sstephenson/ruby-build/issues/305 我试图通过这种方式安装最新的稳定器,并得到了相同的错误
Following a solution on this thread https://github.com/sstephenson/ruby-build/issues/305 I tried to install latest stable this way and got the same error
env CFLAGS='-g -O2' RUBY_CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline`" rbenv install 2.0.0-p195
有什么想法吗?
推荐答案
尝试使用-with-openssl-dir 选项将OpenSSL添加到配置选项:
Try adding OpenSSL to the config options using the --with-openssl-dir option:
$ CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`" rbenv install 2.0.0-p195
如果您使用的是Homebrew,则需要先运行以下命令,然后再安装OpenSSL:
If you're using Homebrew, you'll need to install OpenSSL before running the above by running:
$ brew install openssl
更新 (请参见下面的@JarkkoLaine的评论):
仅作记录,您无需使用config opts 有了ruby-build和homebrew.但是,我不得不重新安装 使用自制软件的openssl使其起作用:brew卸载openssl;酿造 升级; brew install openssl; rbenv安装2.0.0-p247.请参阅此 更多信息.
Just for the record, you should not need to use the config opts anymore with ruby-build and homebrew. However, I had to reinstall openssl with homebrew to make it work: brew uninstall openssl; brew upgrade; brew install openssl; rbenv install 2.0.0-p247. See this for more info.
这篇关于OpenSSL错误在Mac上使用rbenv安装ruby 2.0.0-p195的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!