Skip to content

Instantly share code, notes, and snippets.

@covard
Last active May 6, 2021 20:25
Show Gist options
  • Save covard/a70df765f21a93b15cabfa56c31ae338 to your computer and use it in GitHub Desktop.
Save covard/a70df765f21a93b15cabfa56c31ae338 to your computer and use it in GitHub Desktop.
This is how to fix issue with installing mysql, with some issue with openssl. Thanks to https://github.com/spenhappenin for finding a way around. Credit where credit is due.

MySQL Gem Install error

If this error keeps happening and will not install by manually installing gem install mysql2. Try the fix below.

An error occurred while installing mysql2 (0.5.1) , and bundler cannot continue.

Fix

$ gem install mysql2 -v '0.5.1' -- --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include

fix with bundler

$ bundle config set --global 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