AWS 服务器上的 Rails 部署 (EBS) | nokogiri-1.13.3-aarch64-linux 与 GLIBC_2.29 相关的问题
已部署我的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我成功的解决方法是使用 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.
错误消息准确地告诉您出了什么问题:
nokogiri.so
,。要解决此问题,您需要获取适合您(旧)目标系统的
nokogiri.so
。您不能只是从较新的系统复制它。The error message tells you exactly what's wrong:
nokogiri.so
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.至少对我来说,我可以通过删除预编译的 nokogiri 并重新编译来解决这个问题。
这里还有一些有用的建议: 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.
There are also some useful recommendations here: https://github.com/evilmartians/terraforming-rails/issues/51