2014-01-23 9 views
7

Ich weiß, dass dies ein Problem ist, das hier viele Male "gelöst" wurde, aber ich habe alle Lösungen ausprobiert und kann es immer noch nicht zum Laufen bringen. Hier ist mein Fehler:Ruby 2.1 und Nokogiri installieren Fehler?

22-01-14 17:57:56> gem install nokogiri 
Building native extensions. This could take a while... 
ERROR: Error installing nokogiri: 
ERROR: Failed to build gem native extension. 

/Users/josh/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb 
Extracting libxml2-2.8.0.tar.gz into tmp//ports/libxml2/2.8.0... OK 
Running 'configure' for libxml2 2.8.0... ERROR, review 'tmp//ports/libxml2/2.8.0/configure.log' to see what happened. 
*** 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=/Users/josh/.rvm/rubies/ruby-2.1.0/bin/ruby 
    /Users/josh/.rvm/gems/ruby-2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:265:in `block in execute': Failed to complete configure task (RuntimeError) 
    from /Users/josh/.rvm/gems/ruby-2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:257:in `chdir' 
    from /Users/josh/.rvm/gems/ruby-2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:257:in `execute' 
    from /Users/josh/.rvm/gems/ruby-2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:65:in `configure' 
    from /Users/josh/.rvm/gems/ruby-2.1.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:108:in `cook' 
    from extconf.rb:101:in `block in <main>' 
    from extconf.rb:119:in `call' 
    from extconf.rb:119:in `block in <main>' 
    from extconf.rb:109:in `tap' 
    from extconf.rb:109:in `<main>' 

extconf failed, exit code 1 

Gem files will remain installed in /Users/josh/.rvm/gems/ruby-2.1.0/gems/nokogiri-1.6.1 for inspection. 
Results logged to /Users/josh/.rvm/gems/ruby-2.1.0/extensions/x86_64-darwin-12/2.1.0-static/nokogiri-1.6.1/gem_make.out 

Wenn ich libxml2 über Gebräu installiert haben:

22-01-14 17:57:56> brew list 
ab  cmake  freetype gettext  jpeg  libksba  libvo-aacenc lzlib  openjpeg proj  speex  xvid 
apple-gcc42 elasticsearch freexl  giflib  json-c  liblwgeom libvorbis memcached openssl  qt  sqlite  xz 
apr  faac  frei0r  git  lame  libogg  libvpx  mongodb  opus  readline texi2html yasm 
apr-util fdk-aac  fribidi  gpp  libass  libpng  libxml2  mysql  orc  redis  theora 
autoconf ffmpeg  gd  graphviz libevent libspatialite libxslt  node  pcre  rtmpdump ttfautohint 
automake fontconfig gdal  grep  libgeotiff libtiff  libyaml  openconnect phantomjs schroedinger wkhtmltopdf 
cloc  fontforge geos  imagemagick libgpg-error libtool  little-cms2 opencore-amr pkg-config sdl  x264 

22-01-14 17:57:56> brew list libxml2 
/usr/local/Cellar/libxml2/2.8.0/bin/xmllint 
/usr/local/Cellar/libxml2/2.8.0/bin/xmlcatalog 
/usr/local/Cellar/libxml2/2.8.0/bin/xml2-config 
/usr/local/Cellar/libxml2/2.8.0/include/libxml2/ (47 files) 
/usr/local/Cellar/libxml2/2.8.0/lib/libxml2.2.dylib 
/usr/local/Cellar/libxml2/2.8.0/lib/pkgconfig/libxml-2.0.pc 
/usr/local/Cellar/libxml2/2.8.0/lib/ (3 other files) 
/usr/local/Cellar/libxml2/2.8.0/share/aclocal/libxml.m4 
/usr/local/Cellar/libxml2/2.8.0/share/doc/ (121 files) 
/usr/local/Cellar/libxml2/2.8.0/share/gtk-doc/ (55 files) 
/usr/local/Cellar/libxml2/2.8.0/share/man/ (4 files) 

und RVM:

22-01-14 17:57:56> rvm list 

rvm rubies 

=* ruby-2.1.0 [ x86_64 ] 

# => - current 
# =* - current && default 
# * - default 

und GCC:

22-01-14 17:57:56> gcc --version 
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) 
Target: x86_64-apple-darwin13.0.2 
Thread model: posix 

ich versucht habe, alles in diesem und anderen Themen: "Install Nokogiri 1.6.1 under Ruby 2.0.0p353 (rvm based installation) fails (OSX Mavericks)?"

Auch habe ich nicht einmal Nokogiri in meinem Gemfile definiert.


OK, fand ich die Datei configure.log:

1 checking build system type... i386-apple-darwin13.0.2 
    2 checking host system type... i386-apple-darwin13.0.2 
    3 checking for a BSD-compatible install... /usr/bin/install -c 
    4 checking whether build environment is sane... yes 
    5 checking for a thread-safe mkdir -p... ./install-sh -c -d 
    6 checking for gawk... no 
    7 checking for mawk... no 
    8 checking for nawk... no 
    9 checking for awk... awk 
10 checking whether make sets $(MAKE)... yes 
11 checking for gcc... gcc-4.2.1 
12 checking whether the C compiler works... no 
13 configure: error: in `/Users/josh/.rvm/gems/ruby-2.1.0/gems/nokogiri-1.6.1/ext/nokogiri/tmp/ports/libxml2/2.8.0/libxml2-2.8.0': 
14 configure: error: C compiler cannot create executables 
15 See `config.log' for more details 

Und im config.log ich gefunden:

83 configure:3326: checking for C compiler version 
84 configure:3335: gcc-4.2.1 --version >&5 
85 configure: line 3337: gcc-4.2.1: command not found 
86 configure:3346: $? = 127 
87 configure:3335: gcc-4.2.1 -v >&5 
88 configure: line 3337: gcc-4.2.1: command not found 
89 configure:3346: $? = 127 
90 configure:3335: gcc-4.2.1 -V >&5 
91 configure: line 3337: gcc-4.2.1: command not found 
92 configure:3346: $? = 127 
93 configure:3335: gcc-4.2.1 -qversion >&5 
94 configure: line 3337: gcc-4.2.1: command not found 
95 configure:3346: $? = 127 
96 configure:3366: checking whether the C compiler works 
97 configure:3388: gcc-4.2.1 conftest.c >&5 
98 configure: line 3390: gcc-4.2.1: command not found 
+1

Und was macht sage dir? –

+0

Ich kann es nirgendwo finden. sudo find/Users/josh/-name mkmf.log – jwilcox09

+0

Nicht sicher, ob das Problem, aber Sie Mac OS Maverick ausgeführt? Hast du Xcode aktualisiert? Öffnen und akzeptieren Sie die neuen Regeln? Und versuchen Sie es erneut ... –

Antwort

7

Es ich das C nicht stellte sich heraus, war Referenzierung Compiler richtig. In meinem ".bash_profile" Ich hatte:

export CC=gcc-4.2.1 

Und ich ersetzt es mit: "Überprüfen Sie die mkmf.log Datei um weitere Informationen zu"

export CC=gcc 
+0

Also jetzt kompiliert der * nokogiri * richtig? –

+0

Ja das erlaubt es, richtig zu kompilieren – jwilcox09

+0

akzeptiere deine Antwort =) –