Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ozbillwang/e85a4e49a0cffd2c7cb1 to your computer and use it in GitHub Desktop.
Save ozbillwang/e85a4e49a0cffd2c7cb1 to your computer and use it in GitHub Desktop.

Fix the issue when run "bundle install" and got "libxml2 is missing" issues


IMPORTANT! Nokogiri builds and uses a packaged version of libxslt.

If this is a concern for you and you want to use the system library instead, abort this installation process and reinstall nokogiri as follows:

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

If you are using Bundler, tell it to use the option:

bundle config build.nokogiri --use-system-libraries
bundle install

Make sure xCode 4.3 is installed first!!!

Command line tools no longer come bundled with xCode, install it by going to:

preferences -> downloads -> command line tools

Install RVM

bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

Then restart terminal

Install Ruby 1.9.3 through RVM (need to specify clang compiler)

rvm install 2.1.3 --with-gcc=clang

Switch from System's Ruby config to our desired Ruby config (and associated gems)

rvm use 2.1.3

run command "bundle install"

bundle config build.nokogiri --use-system-libraries bundle install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment