現状
Railsで開発中のアプリをAWSを用いてデプロイしようと試みている段階です。
EC2でのMysqlの設定を終え、
rake db:create RAILS_ENV=production
をしたところ、タイトルのエラーが表示されてしまいます。
コード
$ sudo rake db:create RAILS_ENV=production Ignoring bcrypt-3.1.16 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.16 Ignoring bindex-0.8.1 because its extensions are not built. Try: gem pristine bindex --version 0.8.1 Ignoring bootsnap-1.4.8 because its extensions are not built. Try: gem pristine bootsnap --version 1.4.8 Ignoring byebug-11.1.3 because its extensions are not built. Try: gem pristine byebug --version 11.1.3 Ignoring ffi-1.13.1 because its extensions are not built. Try: gem pristine ffi --version 1.13.1 Ignoring kgio-2.11.3 because its extensions are not built. Try: gem pristine kgio --version 2.11.3 Ignoring msgpack-1.3.3 because its extensions are not built. Try: gem pristine msgpack --version 1.3.3 rake aborted! LoadError: cannot load such file -- bundler/setup /var/www/rails/kangolog/config/boot.rb:3:in `<top (required)>' /var/www/rails/kangolog/config/application.rb:1:in `require_relative' /var/www/rails/kangolog/config/application.rb:1:in `<top (required)>' /var/www/rails/kangolog/Rakefile:4:in `require_relative' /var/www/rails/kangolog/Rakefile:4:in `<top (required)>' /usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>' (See full trace by running task with --trace)
$ sudo rake db:create RAILS_ENV=production --trace Ignoring bcrypt-3.1.16 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.16 Ignoring bindex-0.8.1 because its extensions are not built. Try: gem pristine bindex --version 0.8.1 Ignoring bootsnap-1.4.8 because its extensions are not built. Try: gem pristine bootsnap --version 1.4.8 Ignoring byebug-11.1.3 because its extensions are not built. Try: gem pristine byebug --version 11.1.3 Ignoring ffi-1.13.1 because its extensions are not built. Try: gem pristine ffi --version 1.13.1 Ignoring kgio-2.11.3 because its extensions are not built. Try: gem pristine kgio --version 2.11.3 Ignoring msgpack-1.3.3 because its extensions are not built. Try: gem pristine msgpack --version 1.3.3 rake aborted! LoadError: cannot load such file -- bundler/setup /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require' /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require' /var/www/rails/kangolog/config/boot.rb:3:in `<top (required)>' /var/www/rails/kangolog/config/application.rb:1:in `require_relative' /var/www/rails/kangolog/config/application.rb:1:in `<top (required)>' /var/www/rails/kangolog/Rakefile:4:in `require_relative' /var/www/rails/kangolog/Rakefile:4:in `<top (required)>' /usr/share/gems/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load' /usr/share/gems/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load_rakefile' /usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:703:in `raw_load_rakefile' /usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:104:in `block in load_rakefile' /usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling' /usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:103:in `load_rakefile' /usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:82:in `block in run' /usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling' /usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:80:in `run' /usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>' /bin/rake:23:in `load' /bin/rake:23:in `<main>'
試したこと
budler installをすれば解決するという記事が多かったので試しましたが、エラー分に変更はありませんでした。
補足
ruby version 2.6.6
rails version 6.0.3.4
Bundler version 1.17.2
EC2OS amazon-linux2
echo $GEM_PATH
を確認すべきと情報を得て、確認したのですが、
コマンドを入力してもなにも表示されません。
これが原因なのでしょうか?
調べてみたのですが、解決方法が見つけることができませんでした。
何かアドバイスなど頂けると幸いです。
よろしくお願い致します。
あなたの回答
tips
プレビュー