0

Trying to install Nokogiri and I get the following error

checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... yes
checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes
checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes
creating Makefile

make
compiling html_document.c
cc1: error: -Werror=shorten-64-to-32: no option -Wshorten-64-to-32
make: *** [html_document.o] Error 1

I think I need to use a brew install gcc rather the one I have, but I can't remember how! :)

I have:

gcc -v
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-darwin12.5.0
Thread model: posix

thanks!

kreek
  • 8,774
  • 8
  • 44
  • 69
  • You can look at the answer provided [here](http://stackoverflow.com/questions/9353444/how-to-use-install-gcc-on-mac-os-x-10-8-xcode-4-4#answer-12238448) – bjhaid Dec 14 '13 at 02:11

1 Answers1

0

Your GCC version looks fine to me. I'm on Mavericks (and it looks like you're on Lion?), so my version is slightly different (x86_64-apple-darwin13.0.0 instead of x86_64-apple-darwin12.5.0) but otherwise identical to what you posted.

I had problems with nokogiri until I had RVM set to use Ruby 1.9.3 as the default instead of 1.9.2. My nokogiri gem was pulled in when I updated Vagrant to 1.4.0, though, and was not installed on its own with a "gem install nokogiri". I just ran a "gem install nokogiri" and it rebuilt without errors for me.

I'd recommend doing the following:

  1. brew update # just in case
  2. rvm use ruby-1.9.3-p392
  3. rvm alias create default ruby-1.9.3-p392
  4. gem install nokogiri