ruby on rails 3-使用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

您有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

请参阅"控制器名称空间和路由"以了解所需的特定路由。

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

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

全部解决。

相关内容

  • 没有找到相关文章

最新更新