更新到rails 5的heroku怪异错误

时间:2018-08-28 15:21:50

标签: heroku ruby-on-rails-5

我正在尝试将旧版应用程序更新到rails 5并在heroku上进行测试,逐步解决我遇到的任何错误。我被困在这一个:

2018-08-28T15:13:59.126154+00:00 heroku[web.1]: State changed from crashed to starting
2018-08-28T15:14:12.497673+00:00 heroku[web.1]: Starting process with command `bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}`
2018-08-28T15:14:15.854909+00:00 app[web.1]: Puma starting in single mode...
2018-08-28T15:14:15.854932+00:00 app[web.1]: * Version 3.12.0 (ruby 2.5.1-p57), codename: Llamas in Pajamas
2018-08-28T15:14:15.854934+00:00 app[web.1]: * Min threads: 5, max threads: 5
2018-08-28T15:14:15.854935+00:00 app[web.1]: * Environment: production
2018-08-28T15:14:30.363354+00:00 app[web.1]: ! Unable to load application: ArgumentError: A class was passed to `:class_name` but we are expecting a string.
2018-08-28T15:14:30.364257+00:00 app[web.1]: bundler: failed to load command: puma (/app/vendor/bundle/ruby/2.5.0/bin/puma)
2018-08-28T15:14:30.364373+00:00 app[web.1]: ArgumentError: A class was passed to `:class_name` but we are expecting a string.
2018-08-28T15:14:30.364376+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/reflection.rb:436:in `initialize'
2018-08-28T15:14:30.364377+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/reflection.rb:31:in `new'
2018-08-28T15:14:30.364379+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/reflection.rb:31:in `create'
2018-08-28T15:14:30.364380+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/associations/builder/association.rb:45:in `create_reflection'
2018-08-28T15:14:30.364382+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/associations/builder/association.rb:31:in `build'
2018-08-28T15:14:30.364383+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/associations.rb:1654:in `belongs_to'
2018-08-28T15:14:30.364385+00:00 app[web.1]:   /app/app/models/match.rb:2:in `<class:Match>'
2018-08-28T15:14:30.364386+00:00 app[web.1]:   /app/app/models/match.rb:1:in `<main>'
2018-08-28T15:14:30.364388+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
2018-08-28T15:14:30.364389+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
2018-08-28T15:14:30.364391+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
2018-08-28T15:14:30.364392+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
2018-08-28T15:14:30.364394+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
2018-08-28T15:14:30.364395+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
2018-08-28T15:14:30.364396+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
2018-08-28T15:14:30.364398+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
2018-08-28T15:14:30.364399+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:374:in `block in require_or_load'
2018-08-28T15:14:30.364401+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:37:in `block in load_interlock'
2018-08-28T15:14:30.364402+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
2018-08-28T15:14:30.364403+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
2018-08-28T15:14:30.364405+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies/interlock.rb:13:in `loading'
2018-08-28T15:14:30.364406+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:37:in `load_interlock'
2018-08-28T15:14:30.364408+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:352:in `require_or_load'
2018-08-28T15:14:30.364409+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:330:in `depend_on'
2018-08-28T15:14:30.364411+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:59:in `depend_on'
2018-08-28T15:14:30.364412+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:244:in `require_dependency'
2018-08-28T15:14:30.364413+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!'
2018-08-28T15:14:30.364415+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:477:in `each'
2018-08-28T15:14:30.364417+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:477:in `block in eager_load!'
2018-08-28T15:14:30.364434+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:475:in `each'
2018-08-28T15:14:30.364435+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:475:in `eager_load!'
2018-08-28T15:14:30.364437+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/engine.rb:356:in `eager_load!'
2018-08-28T15:14:30.364438+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application/finisher.rb:69:in `each'
2018-08-28T15:14:30.364440+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
2018-08-28T15:14:30.364441+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:32:in `instance_exec'
2018-08-28T15:14:30.364443+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:32:in `run'
2018-08-28T15:14:30.364449+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
2018-08-28T15:14:30.364451+00:00 app[web.1]:   /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each'
2018-08-28T15:14:30.364452+00:00 app[web.1]:   /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
2018-08-28T15:14:30.364454+00:00 app[web.1]:   /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from'
2018-08-28T15:14:30.364455+00:00 app[web.1]:   /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component'
2018-08-28T15:14:30.364457+00:00 app[web.1]:   /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `each'
2018-08-28T15:14:30.364458+00:00 app[web.1]:   /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `call'
2018-08-28T15:14:30.364460+00:00 app[web.1]:   /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component'
2018-08-28T15:14:30.364461+00:00 app[web.1]:   /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each'
2018-08-28T15:14:30.364463+00:00 app[web.1]:   /app/vendor/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each'
2018-08-28T15:14:30.364464+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/initializable.rb:60:in `run_initializers'
2018-08-28T15:14:30.364466+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.1/lib/rails/application.rb:361:in `initialize!'
2018-08-28T15:14:30.364467+00:00 app[web.1]:   /app/config/environment.rb:5:in `<top (required)>'
2018-08-28T15:14:30.364468+00:00 app[web.1]:   config.ru:3:in `require_relative'
2018-08-28T15:14:30.364470+00:00 app[web.1]:   config.ru:3:in `block in <main>'
2018-08-28T15:14:30.364471+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in `instance_eval'
2018-08-28T15:14:30.364472+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in `initialize'
2018-08-28T15:14:30.364474+00:00 app[web.1]:   config.ru:in `new'
2018-08-28T15:14:30.364475+00:00 app[web.1]:   config.ru:in `<main>'
2018-08-28T15:14:30.364477+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:49:in `eval'
2018-08-28T15:14:30.364478+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:49:in `new_from_string'
2018-08-28T15:14:30.364480+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/builder.rb:40:in `parse_file'
2018-08-28T15:14:30.364481+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/configuration.rb:318:in `load_rackup'
2018-08-28T15:14:30.364483+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/configuration.rb:243:in `app'
2018-08-28T15:14:30.364484+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/runner.rb:145:in `load_and_bind'
2018-08-28T15:14:30.364485+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/single.rb:96:in `run'
2018-08-28T15:14:30.364487+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/launcher.rb:184:in `run'
2018-08-28T15:14:30.364488+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/cli.rb:78:in `run'
2018-08-28T15:14:30.364490+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/bin/puma:10:in `<top (required)>'
2018-08-28T15:14:30.364491+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/bin/puma:23:in `load'
2018-08-28T15:14:30.364493+00:00 app[web.1]:   /app/vendor/bundle/ruby/2.5.0/bin/puma:23:in `<top (required)>'
2018-08-28T15:14:30.871975+00:00 heroku[web.1]: State changed from starting to crashed

被标记的类似乎正确设置,所以我不确定为什么要停在那里:

class Match < ApplicationRecord
  belongs_to :player_one, class_name: Episode
  belongs_to :player_two, class_name: Episode
  belongs_to :tournament

...

我唯一能想到的就是安装logentries或newrelic,然后查看它是否提供更多详细信息。奇怪,因为它在本地运行良好。

1 个答案:

答案 0 :(得分:1)

您必须这样写

class Match < ApplicationRecord
  belongs_to :player_one, class_name: Episode.name
  belongs_to :player_two, class_name: Episode.name
  belongs_to :tournament

这将解决问题。