tôi thấy rất nhiều câu hỏi thuộc loại này nhưng tôi có một chút tình huống khác nhau, do đó, tôi đang làm bundle install
và nhận điều này:nokogiri thất bại trong việc cài đặt OSX
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20150109-25233-1jiriou.rb extconf.rb --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
checking for iconv using --with-iconv-* flags... no
checking for iconv... no
-----
libiconv is missing. Please locate mkmf.log to investigate how it is failing.
-----
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/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
Gem files will remain installed in /var/folders/sk/x8m9btmj1g58c906v0z3k2br0000gq/T/bundler20150109-25233-o53u4y/nokogiri-1.6.5/gems/nokogiri-1.6.5 for inspection.
Results logged to /var/folders/sk/x8m9btmj1g58c906v0z3k2br0000gq/T/bundler20150109-25233-o53u4y/nokogiri-1.6.5/extensions/universal-darwin-14/2.0.0/nokogiri-1.6.5/gem_make.out
An error occurred while installing nokogiri (1.6.5), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.5'` succeeds before bundling.
Tôi đã libiconv cài đặt, tôi đã cố gắng trong cách này gem install nokogiri -- --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/
gem cài đặt ok nhưng hơn tôi cố gắng bó tôi nhận được cùng một lỗi một lần nữa tình hình tương tự là khi tôi cố gắng làm gem install nokogiri -v '1.6.5'
cài đặt là ok, tôi có thể nhìn thấy đá quý trong danh sách đá quý nhưng có vẻ như bundler không nhìn thấy nó, tôi đã cố gắng bao gồm nó trong tập tin đá quý của tôi với phiên bản cụ thể này nhưng vẫn có lỗi này
Tôi cố gắng này quá, các lỗi tương tự – maki
Kết hợp điều này với phản ứng cbertelegni, nó làm việc! – Tiago