Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error - "gem install rails" - libxml2 is missing

I've been working through the Rails install instructions (http://railsapps.github.io/installrubyonrails-mac.html) and everything was okay up until I got to gem install rails part under New Rails Application. When I ran that I got libxml2 is missing. Here's the log: http://codecascade.com/sIjhQ/raw

I had similar issues install nokogiri, and the only way I was able to get it resolved was with

gem install nokogiri -- --use-system-libraries

I'm on OS X 10.10.2. I also have RubyMine installed if that's potentially relevant.

like image 417
Alvin Jones Avatar asked Mar 18 '15 06:03

Alvin Jones


1 Answers

I just had the same problem and was able to solve it as follows:

Installing Nokogiri separately worked only when using the system libraries:

gem install nokogiri -- --use-system-libraries

...but was still failing when executing bundle install. So just configure bundler to also build Nokogiri using the system libraries:

bundle config build.nokogiri --use-system-libraries
like image 105
NotYanka Avatar answered Sep 21 '22 03:09

NotYanka