我正在尝试在Heroku上托管我的应用程序,我的应用程序已成功构建,但在运行时抛出了无关的错误。请帮助我解决此错误。
heroku日志: 2017-11-28T23:29:01.319086 + 00:00 app [web.1]:/app/app/controllers/Admin/dependents_controller.rb:1:in`':ininitialized constant Admin(NameError。
我正在使用Ruby On Rails和Devise for Admin相关的东西,以下是我的相关文件。
的routes.rb
namespace :admin do
root :to => 'home#index'
resources :dependents
end
应用/控制器/管理/ dependents_controller.rb
class Admin::DependentsController < ApplicationController
end
应用/视图/管理/受抚养人
这有我所有的家属相关的意见
进行更改后的当前heroku日志
Heroku Logs(当前)
2017-11-29T11:11:11.014769+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
2017-11-29T11:11:11.014768+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
2017-11-29T11:11:11.014769+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
2017-11-29T11:11:11.014770+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
2017-11-29T11:11:11.014777+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
2017-11-29T11:11:11.014778+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
2017-11-29T11:11:11.014779+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
2017-11-29T11:11:11.014779+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
2017-11-29T11:11:11.014780+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
2017-11-29T11:11:11.014783+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
2017-11-29T11:11:11.014784+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
2017-11-29T11:11:11.014785+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2017-11-29T11:11:11.014792+00:00 app[web.1]: from config.ru:3:in `require_relative'
2017-11-29T11:11:11.014793+00:00 app[web.1]: from config.ru:3:in `block in <main>'
2017-11-29T11:11:11.014794+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `initialize'
2017-11-29T11:11:11.014794+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `instance_eval'
2017-11-29T11:11:11.014795+00:00 app[web.1]: from config.ru:in `new'
2017-11-29T11:11:11.014798+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/builder.rb:40:in `parse_file'
2017-11-29T11:11:11.014796+00:00 app[web.1]: from config.ru:in `<main>'
2017-11-29T11:11:11.014796+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in `eval'
2017-11-29T11:11:11.014797+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in `new_from_string'
2017-11-29T11:11:11.014798+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/server.rb:319:in `build_app_and_options_from_config'
2017-11-29T11:11:11.014799+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/server.rb:219:in `app'
2017-11-29T11:11:11.014799+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:24:in `app'
2017-11-29T11:11:11.014800+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/server.rb:354:in `wrapped_app'
2017-11-29T11:11:11.014801+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/server.rb:283:in `start'
2017-11-29T11:11:11.014801+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:44:in `start'
2017-11-29T11:11:11.014802+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:135:in `block in perform'
2017-11-29T11:11:11.014802+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in `tap'
2017-11-29T11:11:11.014803+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in `perform'
2017-11-29T11:11:11.014803+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
2017-11-29T11:11:11.014804+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
2017-11-29T11:11:11.014805+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
2017-11-29T11:11:11.014805+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
2017-11-29T11:11:11.014806+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
2017-11-29T11:11:11.014806+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
2017-11-29T11:11:11.014807+00:00 app[web.1]: from bin/rails:9:in `require'
2017-11-29T11:11:11.014808+00:00 app[web.1]: from bin/rails:9:in `<main>'
2017-11-29T11:11:11.215542+00:00 heroku[web.1]: State changed from starting to crashed
2017-11-29T11:11:11.203657+00:00 heroku[web.1]: Process exited with status 1
2017-11-29T16:39:09.572143+00:00 heroku[web.1]: State changed from crashed to starting
2017-11-29T16:39:14.954266+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 6004 -e production`
2017-11-29T16:39:23.078728+00:00 app[web.1]: => Booting Puma
2017-11-29T16:39:23.078767+00:00 app[web.1]: => Rails 5.1.4 application starting in production
2017-11-29T16:39:23.078768+00:00 app[web.1]: => Run `rails server -h` for more startup options
2017-11-29T16:39:23.078775+00:00 app[web.1]: Exiting
2017-11-29T16:39:23.078867+00:00 app[web.1]: /app/app/controllers/Admin/dependents_controller.rb:1:in `<top (required)>': uninitialized constant Admin (NameError)
2017-11-29T16:39:23.078878+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
2017-11-29T16:39:23.078879+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-5.1.4/lib/active_support/concurrency/share_lock.rb:149:in `exclusive'
2017-11-29T16:39:23.078879+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:11:in `loading'
2017-11-29T16:39:23.078882+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/engine.rb:476:in `block (2 levels) in eager_load!'
2017-11-29T16:39:23.078889+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/engine.rb:475:in `each'
2017-11-29T16:39:23.078899+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/engine.rb:475:in `block in eager_load!'
2017-11-29T16:39:23.078900+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/engine.rb:473:in `each'
2017-11-29T16:39:23.078903+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/engine.rb:473:in `eager_load!'
2017-11-29T16:39:23.078903+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/engine.rb:354:in `eager_load!'
2017-11-29T16:39:23.078904+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:67:in `each'
2017-11-29T16:39:23.078905+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:67:in `block in <module:Finisher>'
2017-11-29T16:39:23.078905+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
2017-11-29T16:39:23.078906+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
2017-11-29T16:39:23.078906+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
2017-11-29T16:39:23.078911+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
2017-11-29T16:39:23.078909+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
2017-11-29T16:39:23.078909+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
2017-11-29T16:39:23.078942+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
2017-11-29T16:39:23.078912+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
2017-11-29T16:39:23.078944+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
2017-11-29T16:39:23.078947+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
2017-11-29T16:39:23.078948+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
2017-11-29T16:39:23.078949+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
2017-11-29T16:39:23.078959+00:00 app[web.1]: from config.ru:3:in `require_relative'
2017-11-29T16:39:23.078946+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
2017-11-29T16:39:23.078948+00:00 app[web.1]: from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
2017-11-29T16:39:23.078949+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2017-11-29T16:39:23.078960+00:00 app[web.1]: from config.ru:3:in `block in <main>'
2017-11-29T16:39:23.078962+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `instance_eval'
2017-11-29T16:39:23.078963+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `initialize'
2017-11-29T16:39:23.078964+00:00 app[web.1]: from config.ru:in `new'
2017-11-29T16:39:23.078965+00:00 app[web.1]: from config.ru:in `<main>'
2017-11-29T16:39:23.078984+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in `eval'
2017-11-29T16:39:23.078986+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in `new_from_string'
2017-11-29T16:39:23.078988+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/builder.rb:40:in `parse_file'
2017-11-29T16:39:23.078989+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/server.rb:319:in `build_app_and_options_from_config'
2017-11-29T16:39:23.078990+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/server.rb:219:in `app'
2017-11-29T16:39:23.079011+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/server.rb:354:in `wrapped_app'
2017-11-29T16:39:23.079010+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:24:in `app'
2017-11-29T16:39:23.079013+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.3/lib/rack/server.rb:283:in `start'
2017-11-29T16:39:23.079014+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:44:in `start'
2017-11-29T16:39:23.079030+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:135:in `block in perform'
2017-11-29T16:39:23.079032+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in `tap'
2017-11-29T16:39:23.079033+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in `perform'
2017-11-29T16:39:23.079035+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
2017-11-29T16:39:23.079036+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
2017-11-29T16:39:23.079038+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
2017-11-29T16:39:23.079055+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
2017-11-29T16:39:23.079057+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
2017-11-29T16:39:23.079058+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
2017-11-29T16:39:23.079060+00:00 app[web.1]: from bin/rails:9:in `require'
2017-11-29T16:39:23.079082+00:00 app[web.1]: from bin/rails:9:in `<main>'
2017-11-29T16:39:23.261492+00:00 heroku[web.1]: Process exited with status 1
2017-11-29T16:39:23.274795+00:00 heroku[web.1]: State changed from starting to crashed
答案 0 :(得分:0)
在黑暗中拍摄。这部分:
/app/app/controllers/Admin/dependents_controller.rb:1
似乎很好奇,因为它似乎表明您的admin
(应该是小写)目录实际上名为Admin
(似乎是大写)。
您的目录名称是否正确?