2013-08-03 116 views
5

我試圖用rbenv安裝Ruby 2.0.0-p247,無論我做什麼,我總是收到相同的錯誤。下面是命令和響應:使用rbenv安裝Ruby 2.0.0-p247

$ RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl/1.0.1e rbenv install 2.0.0-p247 
Downloading ruby-2.0.0-p247.tar.gz... 
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz 
Installing ruby-2.0.0-p247... 

BUILD FAILED 

Inspect or clean up the working tree at /var/folders/v1/f8v8hqk12cdcdjwp660mz8fm0000gp/T/ruby-build.20130803134459.46575 
Results logged to /var/folders/v1/f8v8hqk12cdcdjwp660mz8fm0000gp/T/ruby-build.20130803134459.46575.log 

Last 10 log lines: 
installing default gems:  /Users/scottmagdalein1/.rbenv/versions/2.0.0-p247/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? 

我知道這個問題已經被問的其他地方,但這些解決方案仍給我關於OpenSSL的相同的響應。幫幫我?

回答

2

您應該使用CONFIGURE_OPTS而不是RUBY_CONFIGURE_OPTS。

獲取OpenSSL的目錄位置:

brew --prefix openssl 

這裏是我用來在MacOS安裝2.0.0-P247最後的命令:

CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl" rbenv install 2.0.0-p247 
+0

正確!另外,我的主要問題是openssl已經過時,但brew並沒有告訴我。卸載並重新安裝修復它。 –