Heroku - 我们很抱歉,但出了点问题

时间:2014-01-04 17:42:19

标签: ruby-on-rails ruby heroku ruby-on-rails-4

我遇到了Heroku的问题。以下是日志文件:

    2014-01-04T17:37:20.387988+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:774:in `exec_no_cache'
2014-01-04T17:37:20.387988+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:138:in `block in exec_query'
2014-01-04T17:37:20.387988+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:435:in `block in log'
2014-01-04T17:37:20.387988+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
2014-01-04T17:37:20.388346+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:430:in `log'
2014-01-04T17:37:20.388346+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:137:in `exec_query'
2014-01-04T17:37:20.388346+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:921:in `column_definitions'
2014-01-04T17:37:20.388346+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql/schema_statements.rb:174:in `columns'
2014-01-04T17:37:20.388346+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/schema_cache.rb:114:in `block in prepare_default_proc'
2014-01-04T17:37:20.388346+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/schema_cache.rb:56:in `yield'
2014-01-04T17:37:20.388346+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/schema_cache.rb:56:in `columns'
2014-01-04T17:37:20.388346+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/model_schema.rb:208:in `columns'
2014-01-04T17:37:20.388346+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/model_schema.rb:249:in `column_defaults'
2014-01-04T17:37:20.388346+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/locking/optimistic.rb:169:in `column_defaults'
2014-01-04T17:37:20.388568+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/core.rb:171:in `initialize'
2014-01-04T17:37:20.388568+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/inheritance.rb:27:in `new'
2014-01-04T17:37:20.388568+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/inheritance.rb:27:in `new'
2014-01-04T17:37:20.388568+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/devise-3.2.2/app/controllers/devise/sessions_controller.rb:8:in `new'
2014-01-04T17:37:20.388568+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
2014-01-04T17:37:20.388568+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/abstract_controller/base.rb:189:in `process_action'
2014-01-04T17:37:20.388568+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_controller/metal/rendering.rb:10:in `process_action'
2014-01-04T17:37:20.388568+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
2014-01-04T17:37:20.388568+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/callbacks.rb:463:in `_run__1679990542721982613__process_action__callbacks'
2014-01-04T17:37:20.388568+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/callbacks.rb:80:in `run_callbacks'
2014-01-04T17:37:20.388901+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/abstract_controller/callbacks.rb:17:in `process_action'
2014-01-04T17:37:20.388901+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_controller/metal/rescue.rb:29:in `process_action'
2014-01-04T17:37:20.388901+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
2014-01-04T17:37:20.388901+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/notifications.rb:159:in `block in instrument'
2014-01-04T17:37:20.388901+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
2014-01-04T17:37:20.388901+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/notifications.rb:159:in `instrument'
2014-01-04T17:37:20.388901+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
2014-01-04T17:37:20.388901+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
2014-01-04T17:37:20.388901+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
2014-01-04T17:37:20.388901+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/abstract_controller/base.rb:136:in `process'
2014-01-04T17:37:20.389098+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/abstract_controller/rendering.rb:44:in `process'
2014-01-04T17:37:20.389098+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_controller/metal.rb:195:in `dispatch'
2014-01-04T17:37:20.389098+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
2014-01-04T17:37:20.389098+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_controller/metal.rb:231:in `block in action'
2014-01-04T17:37:20.389098+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:80:in `call'
2014-01-04T17:37:20.389098+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
2014-01-04T17:37:20.389098+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:48:in `call'
2014-01-04T17:37:20.389098+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:44:in `call'
2014-01-04T17:37:20.389098+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/journey/router.rb:59:in `each'
2014-01-04T17:37:20.389098+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/journey/router.rb:71:in `block in call'
2014-01-04T17:37:20.389548+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/journey/router.rb:59:in `call'
2014-01-04T17:37:20.389548+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:680:in `call'
2014-01-04T17:37:20.389548+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
2014-01-04T17:37:20.389548+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
2014-01-04T17:37:20.389548+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
2014-01-04T17:37:20.389548+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
2014-01-04T17:37:20.389548+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:25:in `call'
2014-01-04T17:37:20.389548+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
2014-01-04T17:37:20.389548+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
2014-01-04T17:37:20.389548+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/flash.rb:241:in `call'
2014-01-04T17:37:20.389700+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
2014-01-04T17:37:20.389700+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
2014-01-04T17:37:20.389700+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/cookies.rb:486:in `call'
2014-01-04T17:37:20.389700+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/query_cache.rb:36:in `call'
2014-01-04T17:37:20.389700+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
2014-01-04T17:37:20.389700+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
2014-01-04T17:37:20.389700+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/callbacks.rb:373:in `_run__1577560538127818032__call__callbacks'
2014-01-04T17:37:20.389700+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/callbacks.rb:80:in `run_callbacks'
2014-01-04T17:37:20.389700+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2014-01-04T17:37:20.389700+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
2014-01-04T17:37:20.390013+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
2014-01-04T17:37:20.390013+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-01-04T17:37:20.390013+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/rack/logger.rb:38:in `call_app'
2014-01-04T17:37:20.390013+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/rack/logger.rb:20:in `block in call'
2014-01-04T17:37:20.390013+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2014-01-04T17:37:20.390013+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:25:in `tagged'
2014-01-04T17:37:20.390013+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in `tagged'
2014-01-04T17:37:20.390013+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/rack/logger.rb:20:in `call'
2014-01-04T17:37:20.390013+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-01-04T17:37:20.390013+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-01-04T17:37:20.390176+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-01-04T17:37:20.390176+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-01-04T17:37:20.390176+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-01-04T17:37:20.390176+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-01-04T17:37:20.390894+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/backends/base.rb:73:in `start'
2014-01-04T17:37:20.390894+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/server.rb:162:in `start'
2014-01-04T17:37:20.390176+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:511:in `call'
2014-01-04T17:37:20.390176+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:97:in `call'
2014-01-04T17:37:20.390894+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
2014-01-04T17:37:20.390894+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:in `run'
2014-01-04T17:37:20.390176+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-01-04T17:37:20.390176+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/connection.rb:82:in `block in pre_process'
2014-01-04T17:37:20.390176+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/connection.rb:80:in `catch'
2014-01-04T17:37:20.390894+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands/server.rb:84:in `start'
2014-01-04T17:37:20.390894+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
2014-01-04T17:37:20.390176+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/connection.rb:80:in `pre_process'
2014-01-04T17:37:20.390894+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/connection.rb:55:in `process'
2014-01-04T17:37:20.390894+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/connection.rb:41:in `receive_data'
2014-01-04T17:37:20.390894+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
2014-01-04T17:37:20.390894+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
2014-01-04T17:37:20.391121+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
2014-01-04T17:37:20.391121+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
2014-01-04T17:37:20.391121+00:00 app[web.1]:   bin/rails:4:in `require'
2014-01-04T17:37:20.391121+00:00 app[web.1]:   bin/rails:4:in `<main>'
2014-01-04T17:37:20.391121+00:00 app[web.1]: 
2014-01-04T17:37:20.391121+00:00 app[web.1]: 
2014-01-04T17:37:20.386433+00:00 heroku[router]: at=info method=GET path=/users/sign_in host=taskmama.herokuapp.com fwd="92.37.32.135" dyno=web.1 connect=7ms service=91ms status=500 bytes=1266

我的宝石文件:

source 'https://rubygems.org'

ruby '2.0.0'

gem 'rails', '4.0.2'

gem 'sass-rails', '~> 4.0.0'

gem 'uglifier', '>= 1.3.0'

gem 'coffee-rails', '~> 4.0.0'


gem 'jquery-rails'

gem 'turbolinks'

gem 'jbuilder', '~> 1.2'

gem 'devise'

group :doc do
  gem 'sdoc', require: false
end

group :development, :test do
    gem 'rspec-rails', '~> 2.0'
    gem 'sqlite3'
end

group :test do
    gem 'capybara', '~> 2.1.0'
    gem 'shoulda-matchers', '~> 2.4.0'
end

group :production do
gem 'pg'
gem 'rails_12factor'
gem 'thin'
end

我尝试了几乎所有我能找到并做初学者的事情。它部署完美,但页面没有显示。一切都在本地rails服务器上运行良好。谢谢你的帮助!

1 个答案:

答案 0 :(得分:6)

在您的控制台中,您应该可以输入

heroku run rake db:migrate

这与运行

具有相同的效果
rake db:migrate

在你的本地机器上。

您没有在heroku上看到该页面的原因是由于您的控制器正在尝试根据数据库中的记录将某个实例变量传递给视图。但是,如果您尚未迁移数据库,则实例变量的创建将失败,因为您不仅没有记录,也没有数据库模式。

希望有所帮助