【问题标题】:Amazon Ami - Error "instaling nokogiri using bundle"Amazon Ami - 错误“使用捆绑安装 nokogiri”
【发布时间】:2014-02-08 07:16:42
【问题描述】:

如果我执行:

gem install nokogiri -v '1.6.1'

安装成功。

当我执行时:

 bundle install --deployment

我明白了:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
extension.

    /home/ec2-user/.rvm/rubies/ruby-1.9.3-p484/bin/ruby extconf.rb  Extracting libxml2-2.8.0.tar.gz into
tmp/x86_64-amazon-linux/ports/libxml2/2.8.0... OK Running 'configure'
for libxml2 2.8.0... ERROR, review
'tmp/x86_64-amazon-linux/ports/libxml2/2.8.0/configure.log' to see
what happened.
*** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.  Check
the mkmf.log file for more details.  You may need configuration
options.

Provided configuration options:     --with-opt-dir  --without-opt-dir
    --with-opt-include  --without-opt-include=${opt-dir}/include
    --with-opt-lib  --without-opt-lib=${opt-dir}/lib    --with-make-prog
    --without-make-prog     --srcdir=.  --curdir
    --ruby=/home/ec2-user/.rvm/rubies/ruby-1.9.3-p484/bin/ruby
/mnt/sdh/beta/shared/bundle/ruby/1.9.1/gems/mini_portile-0.5.2/lib/mini_portile.rb:265:in
`block in execute': Failed to complete configure task (RuntimeError)
from /mnt/sdh/beta/shared/bundle/ruby/1.9.1/gems/mini_portile-0.5.2/lib/mini_portile.rb:257:in `chdir' 
from /mnt/sdh/beta/shared/bundle/ruby/1.9.1/gems/mini_portile-0.5.2/lib/mini_portile.rb:257:in `execute' 
from /mnt/sdh/beta/shared/bundle/ruby/1.9.1/gems/mini_portile-0.5.2/lib/mini_portile.rb:65:in `configure' 
from /mnt/sdh/beta/shared/bundle/ruby/1.9.1/gems/mini_portile-0.5.2/lib/mini_portile.rb:108:in `cook' 
from extconf.rb:101:in `block in <main>' 
from extconf.rb:119:in `call' 
from extconf.rb:119:in `block in <main>'
from extconf.rb:109:in `tap' 
from extconf.rb:109:in `<main>'


Gem files will remain installed in /mnt/sdh/beta/shared/bundle/ruby/1.9.1/gems/nokogiri-1.6.1 for
inspection. Results logged to /mnt/sdh/beta/shared/bundle/ruby/1.9.1/gems/nokogiri-1.6.1/ext/nokogiri/gem_make.out
An error occurred while installing nokogiri (1.6.1), and Bundler
cannot continue. Make sure that `gem install nokogiri -v '1.6.1'`
succeeds before bundling.

【问题讨论】:

  • 您是否测试过您拥有与您期望的相同版本的 Ruby 和 Rails?发出ruby -vrails -v 进行检查
  • 谢谢,我不知道发生了什么,但我正在运行 rvm use 1.9.3@linkia 并且可以正常工作

标签: ruby-on-rails ruby amazon-ec2 gem nokogiri


【解决方案1】:

我的应用程序在 /mnt/sdh

我的 fstab 文件是 /dev/sdh /mnt/sdh defaults,user 0 0

我只是从 fstab 中删除 'user' 标志然后它运行成功

【讨论】:

    【解决方案2】:

    我在使用 libxml2 for libxml2 2.8.0时遇到了类似的问题

    尝试安装补丁,以便 nokogiri 可以使用:

    sudo yum install -y patch

    然后,安装 nokogiri:

    sudo gem install nokogiri

    我在AWS Developer Forum 上找到了这个答案,它对我有用。

    【讨论】:

      猜你喜欢
      • 2017-01-08
      • 2021-10-27
      • 2013-06-16
      • 1970-01-01
      • 2012-12-16
      • 1970-01-01
      • 2015-05-15
      • 2019-12-28
      • 1970-01-01
      相关资源
      最近更新 更多