前提・実現したいこと
VSCode上でrails db:setupを完了し、アプリ開発がしたい。
git pull出来なかったのでgit cloneからやり直すと
bunndle installは出来ましたがrails db:setupが出来ませんでした。
発生している問題・エラーメッセージ
rails aborted! No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
rails aborted! LoadError: cannot load such file -- parser/lexer /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.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/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:40:in `rescue in require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:26:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/parser-2.7.1.4/lib/parser.rb:67:in `<module:Parser>' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/parser-2.7.1.4/lib/parser.rb:19:in `<main>' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.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/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/rubocop-0.76.0/lib/rubocop.rb:3:in `<main>' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.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/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/config/application.rb:7:in `<main>' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.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/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `require_relative' /Users/tsukaguchikeita/Pray/Reservation-System/Rakefile:4:in `<main>' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `block in load' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:22:in `block in perform' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:20:in `perform' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:48:in `invoke' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<main>' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.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/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/vendor/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>' /Users/tsukaguchikeita/Pray/Reservation-System/bin/spring:15:in `require' /Users/tsukaguchikeita/Pray/Reservation-System/bin/spring:15:in `<top (required)>' bin/rails:3:in `load' bin/rails:3:in `<main>' Caused by: Bootsnap::LoadPathCache::FallbackScan: (See full trace by running task with --trace)
試したこと
VSCode のターミナル上での操作でしょうか? cd コマンドを用いて Rails プロジェクトのあるディレクトリに移動済みですか?
質問ありがとうございます。
cd コマンド用いて、プロジェクトのあるディレクトリに移動済みです。
「rails:db:setup」「rails db:setup」と表記揺れがありますが、「rails db:setup」を実行していますか?
申し訳ありません。rails db:setupを実行しています。
cd コマンドで移動後、ls コマンドを実行すると、app, db, public, bin などのディレクトリは表示されますか?
また、その一覧に Rakefile は表示されていますか?
誠にすみません。
cd Reservation-Systemを用いると
app,bin,Rakefileが表示されます。
このディレクトリでrails db:setupと打つと
rbenv: version `2.6.3' is not installed (set by /Users/tsukaguchikeita/Pray/Reservation-System/.ruby-version)
と表示されたので、インストールしてみます。
Rubyのインストールはできましたが、別のエラーが表示されます。
エラー文が長すぎるので一部削除しました。
Ruby 2.6.3 インストール後、[Cmd] + [Q] で VSCode を一度終了されましたか? (= 再起動しましたか?)
その後も「rails db:setup」はエラーで停止しますか?
エラー文は Gist などを利用すれば、省略せずに全文掲載可能かもしれません、試してみてください (URL で共有できます) : http://gist.github.com/
再起動すると別のエラーがでました。
gem関係のようですが…
Gistを使わせていただきました。
https://gist.github.com/tsuka414/4aec42a895cb25237dd0ed3c9c581970
「bundle install」,「bundle update」2つのコマンドを実行後でも「rails db:setup」はエラーで停止しますか?
また、「bundle exec rails db:setup」を実行しても変化はありませんか?
ご質問の通りのコマンドを実行してみましたが、
変化ありません…。
このエラーで3週間ほど開発が止まっているので、
色々とあがいてみましたが、初期化して一からやり直そうと思います。
親身になって、色々とアドバイスいただきありがとうございました。
あなたの回答
tips
プレビュー