Install Nokogiri 1.6.1 Under Ruby 2.0.0P353 (Rvm Based Installation) Fails (Osx Mavericks)

Install Nokogiri 1.6.1 under Ruby 2.0.0p353 (rvm based installation) fails (OSX Mavericks)?

Check your grep version and install latest via brew:

$ grep --version
grep (BSD grep) 2.5.1-FreeBSD

$ brew install grep --default-names

# If above fails, you probably need to tap
$ brew tap homebrew/dupes
$ brew install grep --default-names

$ grep --version
grep (GNU grep) 2.14.56-1e3d

From (this nokogiri issue)[https://github.com/sparklemotion/nokogiri/issues/935]:
"recent versions of OSX come with BSD grep, while older ones came with GNU grep. And that, your build script, perhaps requires GNU grep"

Stolen from Maverick's comment and duplicated here as an answer and not a comment because I've now run into this issue several times and would love to save someone else the headache. =X

Ruby 2.1 and Nokogiri install error?

It turned out I wasn't referencing the C compiler properly. In my ".bash_profile" I had:

export CC=gcc-4.2.1

And I replaced it with:

export CC=gcc

nokogiri gem installation error

Finally, the problem was caused by nokogiri itself by shipping it's own libxml2 that's incompatible with some systems.

So to install nokogiri I had to tell it that it should use the system libraries.

I installed it manually by:

gem install nokogiri -v 1.6.2.1 -- --use-system-libraries

And it worked well. Other answers didn't solve it.

Why doesn't nokogiri install?

You shouldn't need sudo when you do gem install with rbenv. Unfortunately, the ownership is usually not correct for the .rbenv directory on a new install.

Do this first to set your permissions correctly:

sudo chown -R $USER "$HOME/.rbenv"

Then go ahead and just run the install again:

gem install nokogiri -v '1.6.1'

It should work without sudo.

Vagrant cannot install nokogiri-dependent plugins

I'm on OSX Mavericks and this worked for me:

Set as environment property:

NOKOGIRI_USE_SYSTEM_LIBRARIES=1 

Then install as usual:

vagrant plugin install vagrant-rackspace


Related Topics



Leave a reply



Submit