Skip to content

Instantly share code, notes, and snippets.

@akiatoji
Last active April 6, 2019 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akiatoji/d572322b82dbe8d6586165557a0e41a0 to your computer and use it in GitHub Desktop.
Save akiatoji/d572322b82dbe8d6586165557a0e41a0 to your computer and use it in GitHub Desktop.
Installing mysql2 and nokogiri gems without hassle on macos

Suppress libxml2 version warning. Sometimes the wrong libxml2 version keeps getting loaded.

brew install libxml2 libxslt

Let's say above installed libxml2 2.9.9_2

bundle config --local build.nokogiri "--with-xml2-lib=/usr/local/Cellar/libxml2/2.9.9_2/lib --with-xml2-include=/usr/local/Cellar/libxml2/2.9.9_2/include"

Point mysql2 gem build to brew installed openssl

brew install openssl
bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment