我在OSX Marvericks上使用rvm。 從bundler安裝nokogiri等原生擴展失敗。 但從寶石命令安裝工程。在OSX上捆綁安裝失敗10.9
我還安裝了最新的XCode命令行工具。
我不知道捆綁安裝和gem安裝有什麼區別。
$ rvm requirements Checking requirements for osx. Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date. Requirements installation successful. Yusuke-no-MacBook-Air-2:doorkeeper-jp-admin yandod$ bundle install Fetching gem metadata from https://rubygems.org/......... Fetching additional metadata from https://rubygems.org/.. Resolving dependencies... Using rake 10.3.1 Using bundler 1.6.2 Using mini_portile 0.5.3 Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /Users/yandod/.rvm/rubies/ruby-2.0.0-p451-rvm/bin/ruby extconf.rb /Users/yandod/.rvm/rubies/ruby-2.0.0-p451-rvm/bin/ruby: invalid option -H (-h will show valid options) (RuntimeError) extconf failed, exit code 1 Gem files will remain installed in /Volumes/Macintosh HD 2/develop/doorkeeper-jp-admin/vendor/bundle/gems/nokogiri-1.6.1 for inspection. Results logged to /Volumes/Macintosh HD 2/develop/doorkeeper-jp-admin/vendor/bundle/extensions/x86_64-darwin-13/2.0.0/nokogiri-1.6.1/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.
gem install的結果。
$ gem install nokogiri -v '1.6.1' Building native extensions. This could take a while... Successfully installed nokogiri-1.6.1 1 gem installed
版本的相關軟件:
$ bundle --version Bundler version 1.6.2 $ rvm --version rvm 1.25.25 (stable) by Wayne E. Seguin , Michal Papis [https://rvm.io/] $ gem --version 2.2.2
補充說: 我捆綁配置
$ cat ~/.bundle/config BUNDLE_PATH: ./vendor/bundle BUNDLE_BUILD__NOKOGIRI: --use-system-libraries --with-iconv-dir=/usr/local/opt/libiconv --with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config --with-xslt-config=/usr/local/opt/libxslt/bin/xslt-config
'''bundle install'''在安裝好gem後仍然失敗? – eduardo
即使在「gem install」後它仍然失敗 –
如果安裝了gem,bundler不應該嘗試再次安裝它(在這些情況下,bundler說'使用'而不是'安裝')。你可能在運行gem install nokogiri'''的時候運行'''bundle install'''在另一個ruby/gemset中運行? – eduardo