【发布时间】:2020-10-02 19:00:59
【问题描述】:
我有一个使用 Ruby 2.6.5 (rbenv) 和 Rails 5.2 的 Ruby on Rails 应用程序
我创建了安装脚本来配置 EC2 实例并将应用程序部署到该实例。
它与t3a.micro 实例一致,但如果我使用配置为使用t3a.nano 的相同部署脚本(在t3.nano 上也失败)实例,则始终失败。错误是:
/home/ubuntu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/bundler/spec_set.rb:91:in `block in materialize': Could not find nokogiri-1.10.9 in any of the sources (Bundler::GemNotFound)
from /home/ubuntu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/bundler/spec_set.rb:85:in `map!'
from /home/ubuntu/.rbenv/versions/2.6.5/lib/ruby/2.6.0/bundler/spec_set.rb:85:in `materialize'
...
我可以手动安装 gem:
$ which gem
/home/ubuntu/.rbenv/shims/gem
$ gem install nokogiri
Fetching mini_portile2-2.4.0.gem
Fetching nokogiri-1.10.9.gem
Successfully installed mini_portile2-2.4.0
Building native extensions. This could take a while...
Successfully installed nokogiri-1.10.9
Parsing documentation for mini_portile2-2.4.0
Installing ri documentation for mini_portile2-2.4.0
Parsing documentation for nokogiri-1.10.9
Installing ri documentation for nokogiri-1.10.9
Done installing documentation for mini_portile2, nokogiri after 2 seconds
2 gems installed
$
但如果我 bundle install 应用程序失败:
...
Running 'compile' for libxml2 2.9.10...
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/ubuntu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/nokogiri-1.10.8/mkmf.log
extconf failed, uncaught signal 9
Gem files will remain installed in /home/ubuntu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/nokogiri-1.10.8 for
inspection.
Results logged to
/home/ubuntu/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/nokogiri-1.10.8/gem_make.out
An error occurred while installing nokogiri (1.10.8), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.10.8' --source 'https://rubygems.org/'` succeeds before bundling.
知道发生了什么或如何解决它吗?为什么bundle install 与gem install 的不同之处在于关心我是在micro 还是nano ec2 实例上?
如果您想自己测试,该项目位于 github:https://github.com/mawise/simpleblog 您必须更改 deploymentscripts/deploy-aws.rb 以引用不同的实例类型。
(我知道一些日志引用1.10.8 和其他1.10.9,我看到另一个帖子暗示1.10.9 有问题,所以我尝试了较低版本,结果相同。)
【问题讨论】:
标签: ruby-on-rails ruby amazon-ec2 rubygems bundler