前提・実現したいこと
railsチュートリアル2.3.5を進めています。
Cloud9の動作環境上ではtoy_appが動くのですが、
herokuの本番環境ではApplication Errorが発生してしまいます。
heroku上でも、toy_appを動作成功させたいです。
発生している問題・エラーメッセージ
heroku run rails cでエラーを出力した結果です。
Running rails c on ⬢ scenic-biscayne-75505... up, run.5945 (Free) Traceback (most recent call last): 50: from /app/bin/rails:9:in `<main>' 49: from /app/bin/rails:9:in `require' 48: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<top (required)>' 47: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/command.rb:44:in `invoke' 46: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in `perform' 45: from /app/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch' 44: from /app/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command' 43: from /app/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run' 42: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/commands/console/console_command.rb:96:in `perform' 41: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/command/actions.rb:16:in `require_application_and_environment!' 40: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:329:in `require_environment!' 39: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:329:in `require' 38: from /app/config/environment.rb:5:in `<top (required)>' 37: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:353:in `initialize!' 36: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:58:in `run_initializers' 35: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each' 34: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each' 33: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component' 32: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:347:in `call' 31: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:347:in `each' 30: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component' 29: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from' 28: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' 27: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each' 26: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:59:in `block in run_initializers' 25: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `run' 24: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `instance_exec' 23: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application/finisher.rb:67:in `block in <module:Finisher>' 22: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application/finisher.rb:67:in `each' 21: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/engine.rb:354:in `eager_load!' 20: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/engine.rb:473:in `eager_load!' 19: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/engine.rb:473:in `each' 18: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/engine.rb:475:in `block in eager_load!' 17: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/engine.rb:475:in `each' 16: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/engine.rb:476:in `block (2 levels) in eager_load!' 15: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:251:in `require_dependency' 14: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:335:in `depend_on' 13: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:357:in `require_or_load' 12: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:36:in `load_interlock' 11: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies/interlock.rb:11:in `loading' 10: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/concurrency/share_lock.rb:149:in `exclusive' 9: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies/interlock.rb:12:in `block in loading' 8: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:36:in `block in load_interlock' 7: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:379:in `block in require_or_load' 6: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require' 5: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency' 4: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require' 3: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require' 2: from /app/app/models/micropost.rb:1:in `<top (required)>' 1: from /app/app/models/micropost.rb:4:in `<class:Micropost>' /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/core_ext/object/blank.rb:43:in `presence': wrong number of arguments (given 1, expected 0) (ArgumentError)
該当のソースコード
ruby 2.6.3
Rails 5.1.6
heroku-cli/7.0.9 linux-x64 node-v10.21.0
試したこと
・もう一度railsチュートリアル2章の初めからやり直し、toy_appをherokuにデプロイ
(ソースコードはチュートリアル通りに全てコピーしても、うまくいきませんでした)
・デプロイ後、heroku run rails db:migrateを行うこと
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。