我想通過Yosemite上的RVM安裝Ruby on Rails。一切似乎已經奏效,不過,當我嘗試運行「包安裝」我帶有與引入nokogiri的錯誤:在優勝美地上安裝Nokogiri
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.
的錯誤信息是:
/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
你或許應該讓引入nokogiri使用LIB XML其捆綁的版本,而不是強迫使用一個你已經安裝了(雖然它看起來像它可能會這樣做)另外,應該在錯誤消息中提及具有精確編譯錯誤的日誌文件。 –
尚未在優勝美地上安裝。但我會重新開始使用新的gemset,並確保Nokogiri已列入導軌(或任何其他寶石)。這可以確保Nokogiri使用它的嵌入式libxml2(這可以阻止您在第一個孩子時遇到問題)。另見https://github.com/sparklemotion/nokogiri/issues/742#issuecomment-9082139和https://github.com/sparklemotion/nokogiri/issues/829 –
你可以試試這個答案:http:// stackoverflow。 com/questions/24091869 /正在安裝nokogiri-on-osx-10-10-yosemite?answertab = active#tab-top – activars