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
Ruby Converting String Encoding from Iso-8859-1 to Utf-8 Not Working
Rails Custom Validation Based on a Regex
Ruby on Rails Multiple Http Request at the Same Time
Cannot Install Any Version of Ruby on Mojave - Internal Ranlib Command Failed
How to Inspect What Is the Default Value for Optional Parameter in Ruby's Method
Load Two Ruby Modules/Gems with the Same Name
How to Receive a JSON Object with Rack
How to Install Rails with Jruby
Cocoon Add Association, How to Limit Number of Associations
Ruby: Building a Plot of Function
Difference Between or and || When Setting Variables
How to Reference a Constant in a Yaml with Rails
Rails 3 - How to Set Start Date to Date_Select Method
Installing Rmagick Gem -- Can't Find Magickwand.H
Set Locale Automatically in Ruby on Rails