2015-01-08 12 views
5

ich viele Fragen dieser Art gesehen, aber ich habe etwas andere Situation, so bin ich bundle install tun und bekam dies:nokogiri nicht osx installieren

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. 

ich installiert libiconv habe ich versucht, in auf diese Weise gem install nokogiri -- --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/ Gem installiert ok, aber als ich versuche zu bündeln Ich habe den gleichen Fehler wieder die gleiche Situation ist, wenn ich versuche, gem install nokogiri -v '1.6.5' die Installation ist in Ordnung, kann ich den Edelstein in der Liste der Edelsteine ​​sehen, aber scheint Bundler nicht zu sehen Ich habe versucht, es in meine Edelstein-Datei mit dieser spezifischen Version zu integrieren, aber immer noch diesen Fehler

Antwort

4

Sie könnenverwendenauf diesen Weg gesetzt:

bundle config build.nokogiri "--with-iconv-dir=/usr/local/Cellar/libiconv/1.14/" 
bundle install 
+1

ich das auch versucht, – maki

+0

der gleiche Fehler diese Kombination mit cbertelegni Antwort, es funktionierte! – Tiago

0

Das ist für mich gearbeitet, dank Gergo & cbertelegni:

bundle config build.nokogiri "-- \ 
    --use-system-libraries \ 
    --with-xml2-config=/usr/bin/xml2-config \ 
    --with-xslt-config=/usr/bin/xslt-config" 
bundle install 
4

Das funktioniert für mich bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2"

Führen Sie diesen Befehl, bevor Sie die Konfiguration einstellen bundle install

ich aus https://github.com/sparklemotion/nokogiri/issues/1099 diese Lösung bekam

Verwandte Themen