Tôi đang cố gắng cài đặt Ruby on Rails qua RVM trên Yosemite. Tất cả mọi thứ dường như đã làm việc, tuy nhiên, khi tôi cố gắng để chạy 'bó cài đặt' Tôi đã trình bày với một lỗi liên quan đến Nokogiri:Cài đặt Nokogiri trên Yosemite
pauls-air:~ paulmcguane$ gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
Building native extensions with: '--with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib'
This could take a while...
Building nokogiri using packaged libraries.
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
Các thông báo lỗi là:
/Users/paulmcguane/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
Building nokogiri using packaged libraries.
-----
libiconv 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
--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=/Users/paulmcguane/.rvm/rubies/ruby-2.1.2/bin/ruby
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
extconf failed, exit code 1
Bạn có lẽ nên để cho nokogiri sử dụng phiên bản đóng gói của xml lib chứ không phải buộc việc sử dụng một trong những bạn đã cài đặt (mặc dù nó trông giống như nó có thể được làm điều đó anyway) Ngoài ra cần phải đề cập đến trong thông báo lỗi của một tập tin đăng nhập với lỗi biên dịch chính xác. –
Chưa được cài đặt trên Yosemite. Nhưng tôi sẽ bắt đầu một lần nữa với điều này với một gemset tươi và chắc chắn rằng Nokogiri được liệt kê trước khi đường ray (hoặc bất kỳ đá quý nào khác). Điều này có thể đảm bảo Nokogiri sử dụng libxml2 nhúng của nó (điều này khiến bạn không gặp vấn đề gì với con đầu tiên). xem thêm https://github.com/sparklemotion/nokogiri/issues/742#issuecomment-9082139 và https://github.com/sparklemotion/nokogiri/issues/829 –
Bạn có thể thử câu trả lời này: http: // stackoverflow. com/questions/24091869/install-nokogiri-on-osx-10-10-yosemite? answerertab = active # tab-top – activars