2013-03-19 78 views
9

試圖爲同事設置新的macbook。不好。RVM和OpenSSL的問題

首先,我安裝的OpenSSL:

Heathers-MacBook-Pro:~ heather$ rvm pkg install openssl 
Fetching openssl-1.0.1c.tar.gz to /Users/heather/.rvm/archives 
######################################################################## 100.0% 
Extracting openssl to /Users/heather/.rvm/src/openssl-1.0.1c 
Configuring openssl in /Users/heather/.rvm/src/openssl-1.0.1c. 
Compiling openssl in /Users/heather/.rvm/src/openssl-1.0.1c. 
Installing openssl to /Users/heather/.rvm/usr 

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

    rvm reinstall all --force 

Updating openssl certificates 

然後我嘗試安裝OpenSSL的紅寶石......

Heathers-MacBook-Pro:website heather$ rvm install 1.9.3 --with-openssl-dir=$HOME/.rvm/usr 
Fetching yaml-0.1.4.tar.gz to /Users/heather/.rvm/archives 
Extracting yaml to /Users/heather/.rvm/src/yaml-0.1.4 
Configuring yaml in /Users/heather/.rvm/src/yaml-0.1.4. 
Compiling yaml in /Users/heather/.rvm/src/yaml-0.1.4. 
Installing yaml to /Users/heather/.rvm/usr 
Installing Ruby from source to: /Users/heather/.rvm/rubies/ruby-1.9.3-p392, this may take a while depending on your cpu(s)... 
ruby-1.9.3-p392 - #downloading ruby-1.9.3-p392, this may take a while depending on your connection... 
ruby-1.9.3-p392 - #extracting ruby-1.9.3-p392 to /Users/heather/.rvm/src/ruby-1.9.3-p392 
ruby-1.9.3-p392 - #extracted to /Users/heather/.rvm/src/ruby-1.9.3-p392 
ruby-1.9.3-p392 - #configuring 
ruby-1.9.3-p392 - #compiling 
ruby-1.9.3-p392 - #installing 
Removing old Rubygems files... 
Installing rubygems-1.8.25 for ruby-1.9.3-p392 ... 
Installation of rubygems completed successfully. 
Saving wrappers to '/Users/heather/.rvm/bin'. 
ruby-1.9.3-p392 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake). 
ruby-1.9.3-p392 - #importing default gemsets, this may take time ... 
Install of ruby-1.9.3-p392 - #complete 

Heathers-MacBook-Pro:website heather$ bundle update 
Could not load OpenSSL. 
You must recompile Ruby with OpenSSL support or change the sources in your Gemfile from 'https' to 'http'. Instructions for 
compiling with OpenSSL using RVM are available at rvm.io/packages/openssl. 

順便說一句,創業板的檔案上寫着 「源https://rubygems.org

想法?

回答

11

試試這個:

rvm get head 
rvm pkg remove 
rvm requirements run # if brew gives you warnings about formulas to install, run "brew install" for each before moving on. 

rvm reinstall [the version you need (i.e: 2.0.0)] 
+2

一個澄清評論 - 運行「rvm需求運行」給你一串缺少的自制軟件公式。爲每個運行「brew安裝」。 – 2013-03-19 23:38:29

2

所以這個工作對我來說:

rvm pkg install openssl 
rvm reinstall all --force 

我也有rvm autolibs rvm_pkg一行readline支持。

10

OP實際上救了我的一天! 在我的情況:

$ rvm pkg install openssl 
$ rvm remove 2.4 
$ rvm install 2.4 --with-openssl-dir=$HOME/.rvm/usr 
$ gem install bundler 
1

OpenSSL的版本:1.0.2k

這爲我工作:

brew reinstall openssl 
5

在MacOS 10.12.2通過BREW安裝OpenSSL時,將無法正常工作。要解決它,運行:

export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig:/usr/local/lib/pkgconfig 

,然後通過RVM安裝Ruby。

編輯: 關於問題背後原因的更多信息here

+0

對於較舊版本的Ruby,這一點甚至更爲重要,這些版本可能無法在較新版本的openssl中正常運行。 1.1。這個設置對於製作rvm工作的'--with-openssl-dir'選項至關重要。 – mastaBlasta 2017-11-15 22:05:39

0

這是很對ArchLinux wiki描述:

Ruby版本早於2.4需要OpenSSL的1.0,但RVM將嘗試使用OpenSSL 1.1構建它們。

所以,你可以做(​​最簡單):

$ rvm pkg install openssl 
$ rvm reinstall 2.3.5 -with-openssl-dir=$HOME/.rvm/usr 

你可以看到ArchLinux wiki更多的解決方案。