gem install nokogiri fails if libxml2 and libxslt packages aren’t installed

I’ve had to do a couple of setups over the past few weeks and every time I forget about this so here’s a reminder. The Nokogiri gem requires libxml2 and libxslt to install. Otherwise it throws this horrible make error when  running bundle install (or gem install nokogiri)

Just run sudo apt-get install libxslt-dev libxml2-dev (instructions are here)

Update: Hmmm looks like when i installed postgresql i didn’t install libpq5. Installed this and pg gem now installs correctly 🙂


About distinctinteractive

I graduated 3 years ago from the University of Huddersfield with a 2:1 BA in Interactive Multimedia. After leaving University i worked for a small company in Huddersfield (Offroad Code) mainly helping to maintain a large travel company website. I am currently freelancing as Distinct Interactive. Follow me on Twitter @jimmckerchar
This entry was posted in Gotchas, Ruby and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s