2014-01-19 91 views
2

如果我執行 「以集束instaling引入nokogiri」:亞馬遜阿米 - 錯誤

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. 
+0

您是否測試過您具有您期望的相同版本的Ruby和Rails? 問題 'ruby -v'和'rails -v'來檢查 – Aaron

+0

謝謝 我不知道發生了什麼,但我運行rvm使用[email protected],它的工作原理 –

回答

0

我的應用程序是在/ mnt/SDH

我的fstab文件是的/ dev/SDH到/ mnt/SDH默認,用戶0 0

我只是從fstab刪除'用戶'標誌,然後它運行成功

2

我有一個類似的問題與libxml2的for libxml2 2.8.0

嘗試安裝修補程序,以便引入nokogiri可以使用:

sudo yum install -y patch

然後,安裝引入nokogiri:

sudo gem install nokogiri

我發現這個答案在AWS Developer Forum,它爲我工作。