LoginSignup
1
0

More than 3 years have passed since last update.

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

Last updated at Posted at 2019-05-22

git clone して来てbundle
しようとしても、

Fetching mysql2 0.5.2
Installing mysql2 0.5.2 with native extensions

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

でつまずいて進まない、、、

ボクの場合の解決方法

rubyのバージョンを-v 2.5.3に変更してGemfile.lockを削除

$ rbenv local 2.5.3
$ sudo rm -rf Gemfile.lock

解決コマンド

$ brew install openssl
$ bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include"
$ bundle install

参考サイト

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0