2

我的应用程序在我的本地主机上运行没有问题,但我无法使用 heroku 正确部署它。我已经阅读了有关此问题的所有其他问题,并尝试了多种方法来解决它,但尚未解决。

我已经在下面复制了我的 heroku 日志,因为我无法解决这个问题。

2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/application.rb:136:in `initialize!'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/initializable.rb:55:in `block in run_initializers'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/engine.rb:438:in `block in eager_load!'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/engine.rb:436:in `eager_load!'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:251:in `require'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/engine.rb:438:in `each'
2013-02-12T16:57:40+00:00 app[web.1]: /app/app/controllers/admin/users_controller.rb:1:in `<top (required)>': superclass mismatch for class UsersController (TypeError)
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/config/environment.rb:5:in `<top (required)>'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/railtie/configurable.rb:30:in `method_missing'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:251:in `block in require'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/initializable.rb:30:in `instance_exec'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/initializable.rb:30:in `run'
2013-02-12T16:57:40+00:00 app[web.1]:   from script/rails:6:in `<main>'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:251:in `require'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
2013-02-12T16:57:40+00:00 app[web.1]:   from script/rails:6:in `require'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/config.ru:in `<main>'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:313:in `depend_on'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/config.ru:in `new'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/initializable.rb:54:in `run_initializers'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/initializable.rb:54:in `each'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:236:in `load_dependency'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/commands/server.rb:46:in `app'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/commands.rb:55:in `block in <top (required)>'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/commands/server.rb:70:in `start'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/config.ru:3:in `block in <main>'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/commands.rb:50:in `tap'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
2013-02-12T16:57:40+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/commands.rb:50:in `<top (required)>'
2013-02-12T16:57:41+00:00 heroku[web.1]: Process exited with status 1
2013-02-12T16:57:41+00:00 heroku[web.1]: State changed from starting to crashed
2013-02-12T16:57:41+00:00 heroku[web.1]: State changed from crashed to starting
2013-02-12T16:57:48+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 8575`
2013-02-12T16:58:03+00:00 app[web.1]: => Booting WEBrick
2013-02-12T16:58:03+00:00 app[web.1]: => Rails 3.2.10 application starting in production on http://0.0.0.0:8575
2013-02-12T16:58:03+00:00 app[web.1]: => Call with -d to detach
2013-02-12T16:58:03+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-02-12T16:58:03+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-02-12T16:58:03+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-02-12T16:58:06+00:00 app[web.1]:         provide a secret to prevent exploits that may be possible from crafted
2013-02-12T16:58:06+00:00 app[web.1]:         cookies. This will not be supported in future versions of Rack, and
2013-02-12T16:58:06+00:00 app[web.1]:         SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
2013-02-12T16:58:06+00:00 app[web.1]:         This poses a security threat. It is strongly recommended that you
2013-02-12T16:58:06+00:00 app[web.1]:         future versions will even invalidate your existing user cookies.
2013-02-12T16:58:06+00:00 app[web.1]: 
2013-02-12T16:58:06+00:00 app[web.1]:         Called from: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.10/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.
2013-02-12T16:58:06+00:00 app[web.1]: 
2013-02-12T16:58:10+00:00 app[web.1]: Exiting
2013-02-12T16:58:10+00:00 app[web.1]: /app/app/controllers/admin/users_controller.rb:1:in `<top (required)>': superclass mismatch for class UsersController (TypeError)
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:251:in `require'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:251:in `block in require'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:236:in `load_dependency'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:251:in `require'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:359:in `require_or_load'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:313:in `depend_on'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:225:in `require_dependency'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/engine.rb:438:in `block in eager_load!'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/initializable.rb:30:in `instance_exec'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/initializable.rb:55:in `block in run_initializers'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1
/gems/railties-3.2.10/lib/rails/initializable.rb:54:in `run_initializers'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/engine.rb:438:in `each'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/engine.rb:436:in `each'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/engine.rb:436:in `eager_load!'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/initializable.rb:30:in `run'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/application.rb:136:in `initialize!'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/railtie/configurable.rb:30:in `method_missing'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:251:in `require'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:251:in `block in require'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:236:in `load_dependency'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/config.ru:3:in `block in <main>'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/config.ru:in `new'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/initializable.rb:54:in `each'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.10/lib/active_support/dependencies.rb:251:in `require'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/config/environment.rb:5:in `<top (required)>'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/config.ru:in `<main>'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/commands/server.rb:46:in `app'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/commands/server.rb:70:in `start'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/commands.rb:50:in `tap'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/commands.rb:55:in `block in <top (required)>'
2013-02-12T16:58:10+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.10/lib/rails/commands.rb:50:in `<top (required)>'
2013-02-12T16:58:10+00:00 app[web.1]:   from script/rails:6:in `require'
2013-02-12T16:58:10+00:00 app[web.1]:   from script/rails:6:in `<main>'
2013-02-12T16:58:11+00:00 heroku[web.1]: Process exited with status 1
2013-02-12T16:58:11+00:00 heroku[web.1]: State changed from starting to crashed
2013-02-12T16:58:13+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=guidelines.herokuapp.com fwd=122.149.95.138 dyno= queue= wait= connect= service= status=503 bytes=
2013-02-12T16:58:14+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=guidelines.herokuapp.com fwd=122.149.95.138 dyno= queue= wait= connect= service= status=503 bytes=

我的管理员 usercontroller.rb 是

class Admin::UserController < ApplicationController
  def index
  end
  def new
  end
end
4

2 回答 2

1

你有一个Admin模块或类吗?我已经设置了类似的控制器,如下所示:

admin_controller.rbcontrollers/文件夹中:

class AdminController < ApplicationController
  ...
end

然后是用户的子控制器controllers/admin/users_controller.rb

class Admin::UsersController < AdminController
  def index
  end
  def new
  end
end

然后在您的路线中,您适当地确定范围或命名空间:

#routes.rb
namespace :admin
    resource :users
end

有关您需要的特定路由,请参阅“控制器命名空间和路由” 。

于 2013-02-12T20:35:56.620 回答
0

谢谢 - 我设法解决了这个问题。

当我使用 activeadmin 时,我与管理文件夹中不必要的 user_controller.rb 发生冲突。

都解决了。

于 2013-02-16T12:14:14.273 回答