Skip to content

Instantly share code, notes, and snippets.

@thbar
Created November 21, 2011 08:38
Show Gist options
  • Save thbar/1382048 to your computer and use it in GitHub Desktop.
Save thbar/1382048 to your computer and use it in GitHub Desktop.
Getting Nokogiri to install on Lion
# using rvm with ruby-1.9.2
# latest version 2.7.8 2011-09-16
brew install libxml2
# installing libxslt from source code
wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
tar xvfz libxslt-1.1.26.tar.gz
cd libxslt-1.1.26
./configure --prefix=/usr/local/Cellar/libxslt/1.1.26 --with-libxml-prefix=/usr/local/Cellar/libxml2/2.7.8
make
sudo make install
# installing nokogiri with this new compiled libs
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26
# Optional, within app, incase you need to reinstall
bundle config build.nokogiri --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment