Installing nokogiri Mac OS X 10.8.2 XCode installed

前端 未结 3 1572
爱一瞬间的悲伤
爱一瞬间的悲伤 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: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
    

提交回复
热议问题