前提・実現したいこと
本番環境でrailsの起動コマンド
bundle exec unicorn_rails -c config/unicorn.rb -E production
を実行したときにエラーが出る。
おそらく、ありもしないファイルを読み込もうとしている。
モデルのuser.rbは存在するが、users.rbはどこを指しているのかわからないので、分かる方はよろしくお願いします。
使用しているのは
RDSとEC2です。
これまでのプロセス
gitからpull
gemを bundle install
DBをcreate&migrate
済みです。
それに関するエラーは発生していません。
発生している問題・エラーメッセージ
I, [2020-03-09T03:11:03.714215 #16063] INFO -- : Refreshing Gem list /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:33:in `require': No such file to load -- users.rb (LoadError) from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:378:in `block in require_or_load' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:37:in `block in load_interlock' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:14:in `block in loading' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/concurrency/share_lock.rb:151:in `exclusive' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:13:in `loading' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:37:in `load_interlock' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:356:in `require_or_load' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:48:in `block in require_or_load' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:47:in `require_or_load' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:334:in `depend_on' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:85:in `depend_on' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:246:in `require_dependency' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:477:in `each' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:477:in `block in eager_load!' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:475:in `each' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:475:in `eager_load!' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:356:in `eager_load!' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/application/finisher.rb:69:in `each' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `each' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `call' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!' from /var/www/review-app/config/environment.rb:5:in `<top (required)>' from config.ru:4:in `require_relative' from config.ru:4:in `block in <main>' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rack-2.2.2/lib/rack/builder.rb:125:in `instance_eval' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rack-2.2.2/lib/rack/builder.rb:125:in `initialize' from config.ru:1:in `new' from config.ru:1:in `<main>' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn.rb:56:in `eval' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn.rb:56:in `block in builder' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/bin/unicorn_rails:139:in `block in rails_builder' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:795:in `build_app!' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:139:in `start' from /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/bin/unicorn_rails:209:in `<top (required)>' from /home/ec2-user/.rbenv/versions/2.5.1/bin/unicorn_rails:23:in `load' from /home/ec2-user/.rbenv/versions/2.5.1/bin/unicorn_rails:23:in `<main>'
該当のソースコード
/home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:33:in `require': No such file to load -- users.rb (LoadError)
試したこと
users.rbファイルを作成したりしたが、同様のエラー。
モデルにusers.rbに名前を変更したり、新規に作成したりしたが、同じエラー。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/03/09 17:11
2020/03/11 11:44