19
12

More than 3 years have passed since last update.

[Rails&Docker&MySQLの環境構築] Could not find gem ‘mysql2 (>= 0.4.4, < 0.6.0)’ in any of the gem sources listed in your Gemfile.とエラーメッセージが出てきた。

Last updated at Posted at 2020-12-27

概要

初投稿です。

こちらの動画を見ながら環境構築をしていた最中に
docker-compose build
docker-compose up を実行したら

Could not find gem ‘mysql2 (>= 0.4.4, < 0.6.0)’ in any of the gem sources listed in your Gemfile.
というエラーが出た。

開発環境

macOS catalina
バージョン10.15.7

試したこと

とりあえずググって

  • myslqの再インストール
  • ruby2.5.8から2.6.6へのアップデート
  • docker desktopの再設定

その他諸々のことを試したが色々試したが事象変わらず。
4時間経過。
朝日が登ってきて泣きそうになる。

解決方法

docker-compose run web bundle install
docker-compose up
の順で実行したら解決した。

19
12
1

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
19
12