Rails Gemfile 默认为“https” - “捆绑安装”失败

发布于 2025-01-02 22:17:52 字数 474 浏览 4 评论 0原文

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

source 'https://rubygems.org'

而不是

source 'http://rubygems.org'

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

/Users//.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799 : [BUG] 分段错误

如果我手动将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

猫瑾少女 2025-01-09 22:17:52

您可能正在使用 MacPorts。除了本地 openssl 之外,它还会安装自己版本的 openssl,这会导致问题。如果是这种情况,按照这些说明操作

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

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:

rvm remove ruby-1.9.3
rvm install ruby-1.9.3 --with-openssl-dir=/opt/local
世俗缘 2025-01-09 22:17:52

我之前在使用针对不同版本的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文