Installing nokogiri Mac OS X 10.8.2 XCode installed

和自甴很熟 提交于 2019-12-03 00:48:48

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

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!