Installing nokogiri Mac OS X 10.8.2 XCode installed

前端 未结 3 1573
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-04 10:22

Trying to install nokogiri on Mountain Lion. I was using ruby 1.8.7 but just upgraded to 1.9.3 but it stopped the bundle install from working.

Incidentally, I could get

相关标签:
3条回答
  • 2021-02-04 10:38

    Try these. I faced the same issue and it worked for me. First install libxml2 and then run bundler again.

     brew install libxml2
     brew link libxml2
    

    Source: http://decielo.com/articles/11/rails-3-on-lion-hey-ho-lets-go

    Update:

    I am hoping that you have homebrew installed. If you don't have homebrew then I will suggest you to install homebrew and then install libxml2 and then bundler. Don't use mac ports in case you don't have homebrew.

    Update:

    It's not an issue of command line tools. It's failing at libxml. Try to read the error and you will see

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

    And that's the issue

    0 讨论(0)
  • 2021-02-04 10:42

    After short research I find out what problem can be simply solved by creating symbolic link

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

    works for me hope for you too

    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
    
    0 讨论(0)
  • 2021-02-04 10:54

    I think this is the most important bit of the error message:

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

    Some part of the build process is whining that that directory has permissions such that anyone can write to it. You could try to hunt it down - or you could fix it.

    0 讨论(0)
提交回复
热议问题