I decided to reinstall Rails on my Mac following the install Rails Guide but it's failing when it tries to gem install nokogiri
. I'm running Mac OSX version 10.10.5 and have ruby version 2.2.1p85 currently installed.
I get the following errors:
Running git apply with /Users/parkour/.rvm/gems/ruby-2.0.0-p643/gems/nokogiri-1.6.7.2/patches/libxslt/0017-Updated-config.guess.patch... OK
Running 'configure' for libxslt 1.1.28... OK
Running 'compile' for libxslt 1.1.28... OK
Running 'install' for libxslt 1.1.28... OK
Activating libxslt 1.1.28 (from /Users/parkour/.rvm/gems/ruby-2.0.0-p643/gems/nokogiri-1.6.7.2/ports/x86_64-apple-darwin14.1.0/libxslt/1.1.28)...
checking for main() in -llzma... yes
checking for xmlParseDoc() in libxml/parser.h... no
checking for xmlParseDoc() in -lxml2... no
checking for xmlParseDoc() in -llibxml2... no
-----
libxml2 is missing. Please locate mkmf.log to investigate how it is failing.
-----
*** 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.
So far I've tried the following commands with no success:
brew install libxml2
(suggested here)
xcode-select --install gem install nokogiri bundle config build.nokogiri --use-system-libraries bundle install
(suggested here)
brew install libxml2 libxslt libiconv NOKOGIRI_USE_SYSTEM_LIBRARIES=1 gem install nokogiri -- --use-system-libraries --with-iconv-dir="$(brew --prefix libiconv)" --with-xml2-config="$(brew --prefix libxml2)/bin/xml2-config" --with-xslt-config="$(brew --prefix libxslt)/bin/xslt-config"
and
ARCHFLAGS="-arch x86_64" gem install nokogiri
(both suggested here)
Can anyone provide alternative solutions that might work?
Thank you in advance!