AWS 服务器上的 Rails 部署 (EBS) | nokogiri-1.13.3-aarch64-linux 与 GLIBC_2.29 相关的问题

发布于 2025-01-13 00:53:21 字数 1074 浏览 3 评论 0原文

已部署我的 Rails 应用程序,但现在 /var/log/puma/puma.log 文件中出现以下错误

Early termination of worker

ERROR: It looks like you're trying to use Nokogiri as a precompiled native gem on a system with glibc < 2.17:

  /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /var/app/current/vendor/bundle/gems/nokogiri-1.13.3-aarch64-linux/lib/nokogiri/2.7/nokogiri.so) - /var/app/current/vendor/bundle/gems/nokogiri-1.13.3-aarch64-linux/lib/nokogiri/2.7/nokogiri.so

  If that's the case, then please install Nokogiri via the `ruby` platform gem:
      gem install nokogiri --platform=ruby
  or:
      bundle config set force_ruby_platform true

  Please visit https://nokogiri.org/tutorials/installing_nokogiri.html for more help.

[21228] ! Unable to start worker
[21228] /var/app/current/vendor/bundle/gems/nokogiri-1.13.3-aarch64-linux/lib/nokogiri/extension.rb:7:in `require_relative'

另外运行推荐的 gem install nokogiri --platform=ruby 并不能解决问题。

在 64 位 Amazon Linux 2/3.4.3 上运行的 Ruby 2.7

感谢您的帮助。

Have deployed my Rails application but now getting following error in /var/log/puma/puma.log file

Early termination of worker

ERROR: It looks like you're trying to use Nokogiri as a precompiled native gem on a system with glibc < 2.17:

  /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /var/app/current/vendor/bundle/gems/nokogiri-1.13.3-aarch64-linux/lib/nokogiri/2.7/nokogiri.so) - /var/app/current/vendor/bundle/gems/nokogiri-1.13.3-aarch64-linux/lib/nokogiri/2.7/nokogiri.so

  If that's the case, then please install Nokogiri via the `ruby` platform gem:
      gem install nokogiri --platform=ruby
  or:
      bundle config set force_ruby_platform true

  Please visit https://nokogiri.org/tutorials/installing_nokogiri.html for more help.

[21228] ! Unable to start worker
[21228] /var/app/current/vendor/bundle/gems/nokogiri-1.13.3-aarch64-linux/lib/nokogiri/extension.rb:7:in `require_relative'

Also running the recommended gem install nokogiri --platform=ruby doesn't solve the issue.

Ruby 2.7 running on 64bit Amazon Linux 2/3.4.3

Any help is appreciated.

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

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

发布评论

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

评论(3

鹿港小镇 2025-01-20 00:53:21

我成功的解决方法是使用 nokogiri 1.10.10。在 v1.11 之前,nokogiri 不提供预编译的 arch64 二进制文件,因此这将强制实例本地编译 gem。

在您的 Gemfile 中指定:

gem 'nokogiri', '1.10.10'

我之前尝试在 AWS EB 实例配置中将 BUNDLE_FORCE_RUBY_PLATFORM 设置为 true,但这似乎并没有导致 gem 被本机编译。

The workaround I had success with was to use nokogiri 1.10.10. Prior to v1.11, nokogiri did not supply precompiled arch64 binaries, so that will force the instance to compile the gem natively.

In your Gemfile specify:

gem 'nokogiri', '1.10.10'

I previously tried setting BUNDLE_FORCE_RUBY_PLATFORM to true in the AWS EB instance configuration, but that did not seem to cause the gem to be natively compiled.

故人如初 2025-01-20 00:53:21

感谢任何帮助。

错误消息准确地告诉您出了什么问题:

  • 您正在尝试使用预编译的 nokogiri.so
  • 该共享库是在 GLIBC-2.29(或更高版本)系统上编译的,并且 版本
  • 需要您在使用 GLIBC-2.16 或更早版本的系统上运行的

。要解决此问题,您需要获取适合您(旧)目标系统的 nokogiri.so。您不能只是从较新的系统复制它。

Any help is appreciated.

The error message tells you exactly what's wrong:

  • you are trying to use pre-compiled nokogiri.so
  • that shared library was compiled on a GLIBC-2.29 (or newer) system and requires that version
  • you are running on a system with GLIBC-2.16 or earlier.

To fix this, you need to get nokogiri.so that is appropriate for your (old) target system. You can't just copy it from a newer system.

剧终人散尽 2025-01-20 00:53:21

至少对我来说,我可以通过删除预编译的 nokogiri 并重新编译来解决这个问题。

gem uninstall nokogiri
bundle config set force_ruby_platform true
bundle install

这里还有一些有用的建议: https://github.com/evilmartians/terraforming-导轨/问题/51

At least for me, I am able to solve this issue by removing the precompiled nokogiri, and recompiling it.

gem uninstall nokogiri
bundle config set force_ruby_platform true
bundle install

There are also some useful recommendations here: https://github.com/evilmartians/terraforming-rails/issues/51

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