2013-02-12 107 views
2

我的应用在本地主机上没有问题,但是我无法使用heroku正确部署。我已阅读了关于此的所有其他问题,并尝试了许多解决方法,但尚未处理。使用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 
+0

'类的超类不匹配UsersController(TypeError)' 你能分享'UsersController'的类定义吗?如果这在本地工作,则表明您可能有未提交的代码更改,或未将其推送到Heroku。 – catsby 2013-02-12 18:41:31

+0

谢谢 - 复制它上面... – tessad 2013-02-12 18:55:39

+0

它的UsersController,但我的控制器被称为UserController。我之前改变了名字以避免这个错误 - 从哪里得到UsersController的名字? – tessad 2013-02-13 08:27:34

回答

1

你有一个Admin模块或类?我已经像这样设置类似的控制器:

controllers/文件夹admin_controller.rb

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 

请参阅"Controller Namespaces and Routing"为您需要的特定路由。

+0

谢谢,但我仍然得到相同的错误。该错误说UsersController但我的控制器被称为UserController。我之前改变了名字以避免这个错误 - 从哪里得到UsersController的名字? – tessad 2013-02-13 08:28:10

+0

资源'用户'需要'用户'控制器,位于文件'controllers/users_controller.rb'(或子文件夹)中。这是一个Ruby on Rails约定。 – catsby 2013-02-13 14:14:08

+0

谢谢 - 我现在已经添加了一个user_controller.rb,但仍然收到了完全相同的错误消息 – tessad 2013-02-14 22:32:30

0

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

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

全部解决。