2012-09-29 29 views
12

माउंटेन शेर पर नोकोगिरी स्थापित करने का प्रयास कर रहा है। मैं रूबी 1.8.7 का उपयोग कर रहा था लेकिन बस 1.9.3 तक अपग्रेड किया गया लेकिन यह काम करने से बंडल इंस्टॉल को रोक दिया।नाकोगिरि मैक ओएस एक्स 10.8.2 एक्सकोड स्थापित करना

संयोग से, मैं रूबी 1.9.3 को अनइंस्टॉल करके और 1.8.7 पर वापस जाकर इस समस्या को पार कर सकता हूं। लेकिन इस स्पष्ट रूप से एक से इनकी समाधान के बाद से मैं समय से बाकी के लिए 1.8.7 पर अटक जा करने के लिए नहीं चाहता ...

Users-MacBook-Pro:sample_app user$ ls 
Gemfile  app  doc  script 
Gemfile.lock config  lib  spec 
README.md config.ru log  tmp 
Rakefile db  public  vendor 
Ravins-MacBook-Pro:sample_app user$ bundle 
Fetching gem metadata from https://rubygems.org/....... 
/Users/user/.rvm/gems/[email protected]/gems/bundler-1.2.1/lib/bundler.rb:263: warning: Insecure world writable dir /usr/local in PATH, mode 040777 
Using rake (0.9.2.2) 
Using i18n (0.6.1) 
Using multi_json (1.3.6) 
Using activesupport (3.2.8) 
Using builder (3.0.3) 
Using activemodel (3.2.8) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.1) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.1.3) 
Using actionpack (3.2.8) 
Using mime-types (1.19) 
Using polyglot (0.3.3) 
Using treetop (1.4.10) 
Using mail (2.4.4) 
Using actionmailer (3.2.8) 
Using arel (3.0.2) 
Using tzinfo (0.3.33) 
Using activerecord (3.2.8) 
Using activeresource (3.2.8) 
Using addressable (2.3.2) 
Installing nokogiri (1.5.5) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

     /Users/user/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
extconf.rb:86: warning: Insecure world writable dir /usr/local in PATH, mode 040777 
checking for libxml/parser.h... *** 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/user/.rvm/rubies/ruby-1.9.3-p194/bin/ruby 
    --with-zlib-dir 
    --without-zlib-dir 
    --with-zlib-include 
    --without-zlib-include=${zlib-dir}/include 
    --with-zlib-lib 
    --without-zlib-lib=${zlib-dir}/lib 
    --with-iconv-dir 
    --without-iconv-dir 
    --with-iconv-include 
    --without-iconv-include=${iconv-dir}/include 
    --with-iconv-lib 
    --without-iconv-lib=${iconv-dir}/lib 
    --with-xml2-dir 
    --without-xml2-dir 
    --with-xml2-include 
    --without-xml2-include=${xml2-dir}/include 
    --with-xml2-lib 
    --without-xml2-lib=${xml2-dir}/lib 
    --with-xslt-dir 
    --without-xslt-dir 
    --with-xslt-include 
    --without-xslt-include=${xslt-dir}/include 
    --with-xslt-lib 
    --without-xslt-lib=${xslt-dir}/lib 
    --with-libxslt-config 
    --without-libxslt-config 
    --with-pkg-config 
    --without-pkg-config 
    --with-libxml-2.0-config 
    --without-libxml-2.0-config 
    --with-pkg-config 
    --without-pkg-config 
    --with-libiconv-config 
    --without-libiconv-config 
    --with-pkg-config 
    --without-pkg-config 
/Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError) 
You have to install development tools first. 
    from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp' 
    from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header' 
    from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for' 
    from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone' 
    from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
    from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone' 
    from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
    from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in `postpone' 
    from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for' 
    from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:969:in `find_header' 
    from extconf.rb:114:in `<main>' 


Gem files will remain installed in /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5 for inspection. 
Results logged to /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5/ext/nokogiri/gem_make.out 
An error occurred while installing nokogiri (1.5.5), and Bundler cannot continue. 
Make sure that `gem install nokogiri -v '1.5.5'` succeeds before bundling. 

मैं डेवलपर उपकरण सहित Xcode डाउनलोड किया है, इसलिए मैं पता नहीं क्यों यह nokogiri स्थापित नहीं होगा ...

जब मैं सीधे nokogiri स्थापित करने का प्रयास, मैं मिलता है:

ERROR: Error installing nokogiri: 
    ERROR: Failed to build gem native extension. 

     /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
extconf.rb:86: warning: Insecure world writable dir /usr/local in PATH, mode 040777 
checking for libxml/parser.h... *** 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/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/bin/ruby 
    --with-zlib-dir 
    --without-zlib-dir 
    --with-zlib-include 
    --without-zlib-include=${zlib-dir}/include 
    --with-zlib-lib 
    --without-zlib-lib=${zlib-dir}/lib 
    --with-iconv-dir 
    --without-iconv-dir 
    --with-iconv-include 
    --without-iconv-include=${iconv-dir}/include 
    --with-iconv-lib 
    --without-iconv-lib=${iconv-dir}/lib 
    --with-xml2-dir 
    --without-xml2-dir 
    --with-xml2-include 
    --without-xml2-include=${xml2-dir}/include 
    --with-xml2-lib 
    --without-xml2-lib=${xml2-dir}/lib 
    --with-xslt-dir 
    --without-xslt-dir 
    --with-xslt-include 
    --without-xslt-include=${xslt-dir}/include 
    --with-xslt-lib 
    --without-xslt-lib=${xslt-dir}/lib 
    --with-libxslt-config 
    --without-libxslt-config 
    --with-pkg-config 
    --without-pkg-config 
    --with-libxml-2.0-config 
    --without-libxml-2.0-config 
    --with-pkg-config 
    --without-pkg-config 
    --with-libiconv-config 
    --without-libiconv-config 
    --with-pkg-config 
    --without-pkg-config 
/Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError) 
You have to install development tools first. 
    from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp' 
    from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header' 
    from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for' 
    from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone' 
    from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
    from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone' 
    from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
    from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in `postpone' 
    from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for' 
    from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:969:in `find_header' 
    from extconf.rb:114:in `<main>' 


Gem files will remain installed in /Users/ravinthambapillai/.rvm/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5 for inspection. 
Results logged to /Users/ravinthambapillai/.rvm/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5/ext/nokogiri/gem_make.out 

developer tools components tab धन्यवाद,

developer tools install photo

+0

मुझे लगता है कि आप सीधे उसी बिंदु पर नोकोगिरी स्थापित करने की कोशिश कर रहे हैं ndle? –

+0

मैंने अभी त्रुटि संदेश जोड़ा है जो मुझे सीधे – Ravin

+1

में नोकोगिरी स्थापित करने का प्रयास करते समय मिलता है @ravin यह कमांड लाइन टूल्स का मुद्दा नहीं है .. –

उत्तर

30

कम अनुसंधान के बाद मुझे पता है कि समस्या क्या बस मेरे लिए प्रतीकात्मक कड़ी

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2 

काम करता है बनाने के द्वारा हल किया जा सकता है आपके लिए भी आशा है

gem install nokogiri 
Building native extensions. This could take a while... 
ERROR: Error installing nokogiri: 
    ERROR: Failed to build gem native extension. 

     /Users/morozovm/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb 
checking for libxml/parser.h... *** extconf.rb failed *** 

bash-3.2$ sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2 
Password: 
bash-3.2$ gem install nokogiri 
Building native extensions. This could take a while... 
Successfully installed nokogiri-1.5.6 
1 gem installed 
+1

यह मेरे लिए भी काम करता है। मुझे पता था कि यह इस तरह की समस्या थी लेकिन गंभीरता से ... अपना समय कैसे खोना है ... – Nazka

+1

बिल्कुल सही। मेरे लिए काम किया एक्सकोड को संस्करण 5 में अपग्रेड करते समय समस्या थी (रेल 4, रूबी 2.0.0-पी 1 9 5) – Ari53nN3o

-3

मुझे लगता है कि यह त्रुटि संदेश का सबसे महत्वपूर्ण बिट है:

warning: Insecure world writable dir /usr/local in PATH, mode 040777 

निर्माण प्रक्रिया का कुछ भाग शिकायत की जाती है कि उस निर्देशिका ऐसी है कि किसी को भी यह लिख सकते हैं अनुमतियां हैं। आप इसे शिकार करने का प्रयास कर सकते हैं - या आप इसे ठीक कर सकते हैं।

+1

बिलकुल नहीं। यह पूरी तरह से संदर्भ से बाहर है .. –

1

इन्हें आजमाएं। मुझे एक ही मुद्दे का सामना करना पड़ा और यह मेरे लिए काम किया। सबसे पहले libxml2 स्थापित करें और फिर बंडलर फिर से चलाएं।

brew install libxml2 
brew link libxml2 

स्रोत: http://decielo.com/articles/11/rails-3-on-lion-hey-ho-lets-go

अद्यतन:

मैं आशा करता हूं कि आप homebrew स्थापित किया है। यदि आपके पास होमब्रू नहीं है तो मैं आपको होमब्रू स्थापित करने और फिर libxml2 और फिर बंडलर स्थापित करने का सुझाव दूंगा। यदि आपके पास होमब्रू नहीं है तो मैक पोर्ट्स का उपयोग न करें।

अद्यतन:

यह कमांड लाइन उपकरण का कोई मुद्दा नहीं है। यह libxml में विफल रहा है। त्रुटि पढ़ने की कोशिश करें और आप

checking for libxml/parser.h... *** extconf.rb failed *** 

देखेंगे और वह इस मुद्दे को

+2

अफसोस की बात यह मेरी मदद नहीं की है (मुझे एक समान समस्या है)। मैंने 'libxml2' और' libxslt' को लिंक किया है लेकिन मुझे अभी भी 'libxml/parser.h' @Ravin ऊपर मिल रहा है। कोई और सुझाव? –

+0

यू एक ही त्रुटि हो रही है? libxml/parser.h की जांच ... *** extconf.rb असफल *** –