2011-11-04 24 views
36

Đây là bó lỗi chạy cài đặt nhà cung cấp/đá quý trên máy chủ:Lỗi khi cài đặt Nokogiri 1.5.0 với đường ray 3.1.0 và ubuntu

Installing nokogiri (1.5.0) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

     /home/dtt/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
checking for libxml/parser.h... no 
----- 
libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies. 
----- 
*** 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/dtt/.rvm/rubies/ruby-1.9.2-p290/bin/ruby 
     --with-zlib-dir 
     --without-zlib-dir 
     --with-zlib-include 
     --without-zlib-include=${zlib-dir}/include 
     --with-zlib-lib 
     --without-zlib-lib=${zlib-dir}/lib 
     --with-iconv-dir 
     --without-iconv-dir 
     --with-iconv-include 
     --without-iconv-include=${iconv-dir}/include 
     --with-iconv-lib 
     --without-iconv-lib=${iconv-dir}/lib 
     --with-xml2-dir 
     --without-xml2-dir 
     --with-xml2-include 
     --without-xml2-include=${xml2-dir}/include 
     --with-xml2-lib 
     --without-xml2-lib=${xml2-dir}/lib 
     --with-xslt-dir 
     --without-xslt-dir 
     --with-xslt-include 
     --without-xslt-include=${xslt-dir}/include 
     --with-xslt-lib 
     --without-xslt-lib=${xslt-dir}/lib 


Gem files will remain installed in /vol/www/emclab/releases/20111104001151/vendor/gems/ruby/1.9.1/gems/nokogiri-1.5.0 for inspection. 
Results logged to /vol/www/emclab/releases/20111104001151/vendor/gems/ruby/1.9.1/gems/nokogiri-1.5.0/ext/nokogiri/gem_make.out 
An error occured while installing nokogiri (1.5.0), and Bundler cannot continue. 
Make sure that `gem install nokogiri -v '1.5.0'` succeeds before bundling. 

Bạn có thể bỏ qua phần này. Các thông báo lỗi là khá nhiều tự giải thích, nhưng trang web đòi hỏi một vài từ hơn giải thích mã.

Mọi suy nghĩ?

+8

giải quyết bằng cách cài đặt một lib: rvmsudo apt-get install libxslt1-dev – user938363

+0

bạn đã cứu tôi nhờ. – RSK

+0

@ user938363: Nên đăng câu trả lời và chấp nhận –

Trả lời

61

Bạn cần có tất cả thư viện cần thiết được cài đặt trên máy của mình. Khi bạn cài đặt RVM, nó nên có liệt kê này cho bạn. Trên phiên bản hiện tại của rvm, bạn có thể chạy rvm requirements để xem danh sách chính xác. Ngay bây giờ, danh sách đó là:

sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

25

Bạn đang thiếu một số gói. Thử chạy này (Linux):

$ sudo apt-get install libxslt-dev libxml2-dev 
+0

Cảm ơn, nó hoạt động trên debian. – northtree

4

Chỉ cần làm điều này:

sudo apt-get install libxslt-dev libxml2-dev libxml2 

sau đó gõ này trong terminal (linux)/cmd (cửa sổ):

export NOKOGIRI_USE_SYSTEM_LIBRARIES=true 
+2

'xuất NOKOGIRI_USE_SYSTEM_LIBRARIES = true' đã hoạt động đối với tôi trên Ubuntu. Cảm ơn! Tôi nghĩ rằng trong khi cài đặt nokogiri, sử dụng cờ '--use-system-libraries' sẽ có tác dụng tương tự. Nhưng nếu bạn đang sử dụng 'bundle install' trên một số' Gemfile', tôi đoán cách tốt nhất là đặt tùy chọn cấu hình đó. – basicallydan

0

thử cái này nếu người khác không làm việc, nó thực sự làm việc với tôi. Devtools for CentOS

+0

Thay vì đăng liên kết, hãy tóm tắt GÌ trên trang đó đã giúp. Liên kết thối, vì vậy khi điều này không có câu trả lời sẽ không có giá trị. –

0

Khi tôi sử dụng mã này tôi nhận được một lỗi:

ERROR: Error installing disposable: 
    invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /home/admin/.rvm/gems/[email protected]/cache/nokogiri-1.6.4.1.gem 

tôi đã cố gắng rất nhiều giải pháp khác nhau, nhưng đã giúp med:

$ rm /home/admin/.rvm/gems/[email protected]/cache/nokogiri-1.6.4.1.gem 
$ gem update 
$ gem install nokogiri 

lệnh khác có thể giúp:

sudo apt-get install synaptic 
sudo apt-get update 
sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui 
sudo apt-get install build-essential 
sudo apt-get install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev 
5

Dường như lỗi phụ thuộc đá quý.

Bạn cần chạy lệnh bundle update. Nó sẽ giải quyết phụ thuộc:

bundle update 
Các vấn đề liên quan