更新 Gem (Ruby) 时捆绑器分段错误

发布于 2025-01-20 20:28:35 字数 2920 浏览 5 评论 0原文

如果我尝试使用 Bundler 更新 Gem,我会收到分段错误错误。

(完全错误位于 https://pastebin.com/Ln8EwPwa

myapp% bundle update --conservative byebug
The git source `git://github.com/rails/coffee-rails.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
The git source `git://github.com/rails/web-console.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/./home/myapp/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:118: [BUG] Segmentation fault at 0x00000000000070
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-freebsd12.3]

...
...
...

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

zsh: abort (core dumped)  bundle update --conservative byebug

背景:

我尝试修复我的 Ruby on Rails Web 应用程序,因为 puma 在 2 天后因分段错误而崩溃。为此,我试图找到具有 c 扩展名的库:

bundle show --paths | ruby -e "STDIN.each_line {|dep| puts dep.split('/').last if File.directory?(File.join(dep.chomp, 'ext')) }"

输出:

bcrypt-3.1.16
byebug-8.2.2
concurrent-ruby-1.1.9
debug_inspector-0.0.2
ffi-1.15.4
hiredis-0.5.2
json-1.8.6
nio4r-1.2.1
nokogiri-1.10.10
pg-0.18.4
puma-3.12.6
rb-fsevent-0.11.0
thread_safe-0.3.6
unf_ext-0.0.7.7
websocket-driver-0.6.3

然后我尝试使用 Bundler 更新 Gem,但出现了分段错误错误。

  1. 系统:
  • FreeBSD 12.3-RELEASE-p1 GENERIC
  • Ruby 2.3.1p112
  • Rais 5.0.0.beta2
  • Bundler 1.17.3
  • Gem 2.5.1
  • Puma 3.12.6
  1. 场景:

我使用旧的 Ruby 版本 (2.3.1p112),因为我维护一个 Web 应用程序FreeBSD12.3 上的旧代码库。

遗憾的是,我无法使用 rvm 安装这个 Ruby 版本,因为它不受支持(所以我必须使用 rbenv)。此外,它与较新的 openssl 版本不兼容。所以我必须手动安装 OpenSSL 1.0.2q(因为它不在 FreeBSD Repos 中)。之后,我使用“pkg remove openssl”从 Freebsd 中删除了预装的 OpenSSL(因为 ruby​​ 安装无法使用它),并使用以下命令安装了 Ruby:

RUBY_CONFIGURE_OPTS="--with-openssl-dir=/opt/openssl-1.0.2q" rbenv install 2.3.1

Ruby 安装正常,但要运行 puma,我必须从 freebsd (1.1.1) 重新安装 openssl。 1n) 然后我可以运行我的应用程序并使用“Gem install ...”安装 Gems 并使用“bundle install”或“bundle show”

但是如果我想更新特定的 Gem使用 Bundler 我收到错误。

If i try to update a Gem with Bundler, i got an Segmentation Fault Error.

(Full Error at https://pastebin.com/Ln8EwPwa )

myapp% bundle update --conservative byebug
The git source `git://github.com/rails/coffee-rails.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
The git source `git://github.com/rails/web-console.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/./home/myapp/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:118: [BUG] Segmentation fault at 0x00000000000070
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-freebsd12.3]

...
...
...

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

zsh: abort (core dumped)  bundle update --conservative byebug

Background:

I tried to fix my Ruby on Rails Webapp because puma crashes after 2 days with an segmentation fault. To do this, i tried to find the libaries with c extension with:

bundle show --paths | ruby -e "STDIN.each_line {|dep| puts dep.split('/').last if File.directory?(File.join(dep.chomp, 'ext')) }"

Output:

bcrypt-3.1.16
byebug-8.2.2
concurrent-ruby-1.1.9
debug_inspector-0.0.2
ffi-1.15.4
hiredis-0.5.2
json-1.8.6
nio4r-1.2.1
nokogiri-1.10.10
pg-0.18.4
puma-3.12.6
rb-fsevent-0.11.0
thread_safe-0.3.6
unf_ext-0.0.7.7
websocket-driver-0.6.3

Then i tried to updating a Gem with Bundler and i got an Segmentation Fault Error.

  1. System:
  • FreeBSD 12.3-RELEASE-p1 GENERIC
  • Ruby 2.3.1p112
  • Rais 5.0.0.beta2
  • Bundler 1.17.3
  • Gem 2.5.1
  • Puma 3.12.6
  1. Scenario:

I use a old Ruby Version (2.3.1p112) because i maintain a Webapp with an old code-base on FreeBSD12.3.

Sadly, i cant install this Ruby Version with rvm, cause its not supported (so i have to use rbenv). In addition, its not compatible with newer openssl Versions. So i had to manually install OpenSSL 1.0.2q (because its not in the FreeBSD Repos). After that i removed the preinstalled OpenSSL from Freebsd with "pkg remove openssl" (because ruby installation wont work with it) and installed Ruby with the following Command:

RUBY_CONFIGURE_OPTS="--with-openssl-dir=/opt/openssl-1.0.2q" rbenv install 2.3.1

Ruby installed fine, but to run puma i had to reinstall openssl from freebsd (1.1.1n) and then i can run my App and install Gems with "Gem install ..." and use "bundle install" or "bundle show"

But if i want to update a specific Gem with Bundler i get the error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文