質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.35%
Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

845閲覧

rails db:migrateが上手く行きません

Yuki0531

総合スコア11

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2020/06/16 12:07

$ rails db:migrateを実行すると以下のメッセージが出てきて上手くいかないです。

rails aborted! LoadError: dlopen(/Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/mysql2-0.5.3/lib/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/opt/mysql/lib/libmysqlclient.21.dylib Referenced from: /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/mysql2-0.5.3/lib/mysql2/mysql2.bundle Reason: image not found - /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/mysql2-0.5.3/lib/mysql2/mysql2.bundle /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/mysql2-0.5.3/lib/mysql2.rb:36:in `<main>' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/config/application.rb:7:in `<main>' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:49:in `require_relative' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/Rakefile:4:in `<main>' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `block in load' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:22:in `block in perform' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:20:in `perform' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:48:in `invoke' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<main>' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/naganoyuki/Desktop/Vessel_Trade_Queen/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require' bin/rails:4:in `<main>' (See full trace by running task with --trace)

以下説明を参考にしたのですが、それでも上手く行きませんでした。。。
https://qiita.com/yamazaki8934/items/48e65850873f3ecbee26

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

以下ページを参照して解決しました。
https://qiita.com/Yuki0531/items/5fb5531e1f40db92d3d1

投稿2020/06/20 09:40

Yuki0531

総合スコア11

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.35%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問