Rails Gemfile默认为'https' - 'bundle install'失败

时间:2012-02-03 23:04:17

标签: ruby-on-rails ruby rubygems bundler

我注意到在生成新的rails项目时,Gemfile现在默认为:

source 'https://rubygems.org'

而不是

source 'http://rubygems.org'

现在bundle install对我失败了。当它试图运行时,我得到:

/Users/<my user name>/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault

如果我手动将Gemfile更改为http,则bundle install执行正常。

我的设置是否有错误(我在两个不同的盒子上复制了这个),还是有其他问题我不知道?

2 个答案:

答案 0 :(得分:4)

您可能正在使用MacPorts。除了你的本地openssl之外,它还会安装自己的openssl版本,这会导致问题。如果是这种情况, follow these instructions

rvm remove ruby-1.9.3
rvm install ruby-1.9.3 --with-openssl-dir=/opt/local

答案 1 :(得分:2)

我之前在使用针对不同版本的libssl-dev编译的Ruby版本时看到了这个段错误。也就是说,如果你已经更新了libssl,而不是libssl-dev,那么在构建你的rvm ruby​​时,ruby会在链接到libssl时发生段错误,因为它是用错误的头构建的。我所做的就是确保更新了libssl-dev,用rvm remove核对我的ruby,并再次构建它。

编辑:我知道我在某个地方找到了更多相关信息。 Turns out it was on the RVM site itself。我将rvm指向我用macports --with-openssl-dir=/opt/local/usr/local安装的ssl,个人。