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

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

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

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

Ruby on Rails

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

データベース

データベースとは、データの集合体を指します。また、そのデータの集合体の共用を可能にするシステムの意味を含めます

Q&A

0回答

650閲覧

rails db:createができない

M.Kazu

総合スコア4

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

Ruby on Rails

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

データベース

データベースとは、データの集合体を指します。また、そのデータの集合体の共用を可能にするシステムの意味を含めます

0グッド

0クリップ

投稿2020/01/23 04:45

前提・実現したいこと

Ruby on Railsで新たなプロジェクトを作っています。
rails 5.2.4.1 new (project名) -d mysqlし、bundle installしたところで、rails db:createした際に、以下のエラーメッセージが発生しました。
おそらく、gemの読み込みの段階で、変なところにパスを通してしまっている事か、mysqlの読み込みエラーかと思うのですが、自己解決できずに質問させていただきます。

初めて、こちらのサイトを使いますので必要な情報は全て載せているつもりですが、足りないものあれば教えてください。

何卒、よろしくお願いします。

発生している問題・エラーメッセージ

rails aborted! LoadError: cannot load such file -- mysql2/mysql2 /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:40:in `rescue in require' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:26:in `require' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `block in require' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `require' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /Users/(ユーザー名)/(project名)/config/application.rb:7:in `<top (required)>' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /Users/(ユーザー名)a/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `block in require' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `require' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `require_relative' /Users/(ユーザー名)/(project名)/Rakefile:4:in `<top (required)>' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load' /Users/(ユーザー名)a/(project名)/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:285:in `block in load' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:285:in `load' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.1/lib/rails/commands/rake/rake_command.rb:22:in `block in perform' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.1/lib/rails/commands/rake/rake_command.rb:20:in `perform' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.1/lib/rails/command.rb:48:in `invoke' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.1/lib/rails/commands.rb:18:in `<top (required)>' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `block in require' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:291:in `require' /Users/(ユーザー名)/(project名)/bin/rails:9:in `<top (required)>' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/spring-2.1.0/lib/spring/client.rb:30:in `run' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/spring-2.1.0/bin/spring:49:in `<top (required)>' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load' /Users/(ユーザー名)/(project名)/vendor/bundle/ruby/2.5.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>' /Users/(ユーザー名)/(project名)/bin/spring:15:in `<top (required)>' bin/rails:3:in `load' bin/rails:3:in `<main>' Caused by: Bootsnap::LoadPathCache::FallbackScan:

試したこと

  • HomeBrewのアップデート
  • railsプロジェクトの再度作り直し、
  • gemファイルの見直し

ここまで、個人的に行ってギブアップしました。
以下からが、ググって試したページです。

を参考にしましたが、解決せず、質問させていただきます。

補足情報(FW/ツールのバージョンなど)

MacOS Catalina 10.15.2
Rails 5.2.4.1
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin18]
mysql Server version: 5.7.29 Homebrew
Homebrew 2.2.3

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

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

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

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

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

winterboum

2020/01/23 07:32

bundle install に失敗している可能性があります。 もう一回実行して結果を確認してください
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問