Skip to content

Instantly share code, notes, and snippets.

@MozyOk
Created March 16, 2020 16:21
Show Gist options
  • Save MozyOk/076e16cbf29c101f0801472a77b379c1 to your computer and use it in GitHub Desktop.
Save MozyOk/076e16cbf29c101f0801472a77b379c1 to your computer and use it in GitHub Desktop.
rails mysql2 error

error

make failed, exit code 2

Gem files will remain installed in /Users/mozyok/.anyenv/envs/rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/mysql2-0.5.3 for inspection.
Results logged to /Users/mozyok/.anyenv/envs/rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-18/2.5.0/mysql2-0.5.3/gem_make.out

An error occurred while installing mysql2 (0.5.3), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.5.3' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  mysql2

how to fix

bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib"
bundle install

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