Skip to content

Instantly share code, notes, and snippets.

@jamiebuchanan
Last active November 17, 2022 03:14
Show Gist options
  • Save jamiebuchanan/4572453 to your computer and use it in GitHub Desktop.
Save jamiebuchanan/4572453 to your computer and use it in GitHub Desktop.
Commands to fix "WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.8.0" terminal message on OSX when booting rails env.
gem uninstall nokogiri libxml-ruby
brew update
brew uninstall libxml2
brew install libxml2 --with-xml2-config
brew link libxml2
brew uninstall libxslt
brew install libxslt
brew link libxslt
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.8.0/include/libxml2/ --with-xml2-lib=/usr/local/Cellar/libxml2/2.8.0/lib/ --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28/
NOTE: Also make sure nokogiri comes before your pg gem or a different version of libxml2 will be loaded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment