Created
June 21, 2014 15:48
-
-
Save nhodges/ad54bb220bd4160f93a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
set -x | |
# see also: https://stackoverflow.com/questions/18479240/troubles-with-nokogiri-gem-on-mountain-lion-using-bundler/21744398#21744398 | |
NOKOGIRI_OPTIONS='--use-system-libraries --with-iconv-dir=/usr/local/opt/libiconv --with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config --with-xslt-config=/usr/local/opt/libxslt/bin/xslt-config' | |
brew uninstall libxml2 libxslt || true | |
brew install libiconv | |
brew install https://gist.githubusercontent.com/steakknife/8968844/raw/libxml2.rb --without-python | |
brew install https://gist.githubusercontent.com/steakknife/8969334/raw/libxslt.rb | |
NOKOGIRI_USE_SYSTEM_LIBRARIES=1 gem install nokogiri -- $NOKOGIRI_OPTIONS | |
# --use-system-libraries is broken, NOKOGIRI_USE_SYSTEM_LIBRARIES=1 isn't bundle configurable | |
if which bundle >dev/null 2>&1; then | |
bundle config build.nokogiri $NOKOGIRI_OPTIONS | |
echo '# add to the top of the Gemfile to workaround the nokogiri bundler config bug' | |
echo "ENV['NOKOGIRI_USE_SYSTEM_LIBRARIES'] = '1'" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment