Rails Gemfile 默认为“https” - “捆绑安装”失败
我注意到,在生成新的 Rails 项目时,Gemfile 现在默认为:
source 'https://rubygems.org'
而不是
source 'http://rubygems.org'
现在bundle install
对我来说失败了。当它尝试运行时,我得到:
/Users/
如果我手动将 Gemfile 更改为 http
,则 bundle install
执行正常。
我的设置是否有错误(我已将其复制到两个不同的盒子上),或者是否还有其他我不知道的问题?
I've noticed that when generating a new rails project, the Gemfile now defaults to:
source 'https://rubygems.org'
instead of
source 'http://rubygems.org'
and now bundle install
fails for me. When it attempts to run, I get:
/Users/<my user name>/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault
If I manually change the Gemfile to http
, then bundle install
performs fine.
Is there an error with my setup (I've replicated this on two different boxes), or is there another issue I'm not aware of?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能正在使用 MacPorts。除了本地 openssl 之外,它还会安装自己版本的 openssl,这会导致问题。如果是这种情况,按照这些说明操作:
You're probably using MacPorts. It installs its own version of openssl, in addition to your local openssl, which causes issues. If that's the case, follow these instructions:
我之前在使用针对不同版本的 libssl-dev 编译的 Ruby 版本时见过此段错误。也就是说,如果您更新了 libssl,但没有更新 libssl-dev,那么在构建 rvm ruby 后,ruby 在链接到 libssl 时会出现段错误,因为它是使用错误的标头构建的。我修复它的方法是确保 libssl-dev 已更新,使用
rvm remove
删除我的 ruby,然后再次构建它。编辑:我知道我在某处找到了更多关于此的信息。 原来它位于 RVM 站点本身。我个人将 rvm 指向我用 macports
--with-openssl-dir=/opt/local/usr/local
安装的 ssl。I've seen this segfault previously when using a version of Ruby that was compiled against a different version of libssl-dev. That is, if you've updated libssl, but not libssl-dev, since building your rvm ruby, ruby will segfault when linking to libssl, since it was built with the wrong headers. What I did to fix it was make sure that libssl-dev was updated, nuke my ruby with
rvm remove
, and build it again.EDIT: I knew I found more information about this somewhere. Turns out it was on the RVM site itself. I point rvm to the ssl I have installed with macports
--with-openssl-dir=/opt/local/usr/local
, personally.