我是铁杆和编码的新手。我有一个rials应用程序在我的localhost中工作但是当我将它部署到Heroku时它不起作用。我检查了日志,但我不知道出了什么问题。
如果有人能告诉我为什么我的应用程序不在Heroku中工作以及如何阅读日志,我将非常感激。
2014-05-02T19:02:45.327309+00:00 app[web.1]: LINE 5: WHERE a.attrelid = '"users"'::regclass
2014-05-02T19:02:45.327307+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "users" does not exist
2014-05-02T19:02:45.327310+00:00 app[web.1]: ^
2014-05-02T19:02:45.327312+00:00 app[web.1]: : SELECT a.attname, format_type(a.atttypid, a.atttypmod),
2014-05-02T19:02:45.327313+00:00 app[web.1]: pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
2014-05-02T19:02:45.327315+00:00 app[web.1]: FROM pg_attribute a LEFT JOIN pg_attrdef d
2014-05-02T19:02:45.327316+00:00 app[web.1]: ON a.attrelid = d.adrelid AND a.attnum = d.adnum
2014-05-02T19:02:45.327317+00:00 app[web.1]: WHERE a.attrelid = '"users"'::regclass
2014-05-02T19:02:45.327319+00:00 app[web.1]: AND a.attnum > 0 AND NOT a.attisdropped
2014-05-02T19:02:45.327320+00:00 app[web.1]: ORDER BY a.attnum
2014-05-02T19:02:45.327321+00:00 app[web.1]: ):
2014-05-02T19:02:45.327323+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/connection_adapters/postgresql_adapter.rb:791:in `async_exec'
2014-05-02T19:02:45.327324+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/connection_adapters/postgresql_adapter.rb:791:in `exec_no_cache'
2014-05-02T19:02:45.327326+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:138:in `block in exec_query'
2014-05-02T19:02:45.327327+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/connection_adapters/abstract_adapter.rb:442:in `block in log'
2014-05-02T19:02:45.327329+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
2014-05-02T19:02:45.327330+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/connection_adapters/abstract_adapter.rb:437:in `log'
2014-05-02T19:02:45.327341+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:137:in `exec_query'
2014-05-02T19:02:45.327343+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/connection_adapters/postgresql_adapter.rb:930:in `column_definitions'
2014-05-02T19:02:45.327344+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/connection_adapters/postgresql/schema_statements.rb:187:in `columns'
2014-05-02T19:02:45.327346+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/connection_adapters/schema_cache.rb:114:in `block in prepare_default_proc'
2014-05-02T19:02:45.327347+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/connection_adapters/schema_cache.rb:56:in `yield'
2014-05-02T19:02:45.327348+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/connection_adapters/schema_cache.rb:56:in `columns'
2014-05-02T19:02:45.327362+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/model_schema.rb:208:in `columns'
2014-05-02T19:02:45.327384+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/inheritance.rb:30:in `new'
2014-05-02T19:02:45.327385+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/inheritance.rb:30:in `new'
2014-05-02T19:02:45.327387+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/devise-3.2.4/app/controllers/devise/sessions_controller.rb:8:in `new'
2014-05-02T19:02:45.327364+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/model_schema.rb:249:in `column_defaults'
2014-05-02T19:02:45.327365+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/locking/optimistic.rb:169:in `column_defaults'
2014-05-02T19:02:45.327382+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/core.rb:171:in `initialize'
2014-05-02T19:02:45.327388+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
2014-05-02T19:02:45.327389+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/abstract_controller/base.rb:189:in `process_action'
2014-05-02T19:02:45.327390+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_controller/metal/rendering.rb:10:in `process_action'
2014-05-02T19:02:45.327392+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
2014-05-02T19:02:45.327393+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/callbacks.rb:453:in `_run__583356485245965013__process_action__callbacks'
2014-05-02T19:02:45.327394+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/callbacks.rb:80:in `run_callbacks'
2014-05-02T19:02:45.327396+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/abstract_controller/callbacks.rb:17:in `process_action'
2014-05-02T19:02:45.327397+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_controller/metal/rescue.rb:29:in `process_action'
2014-05-02T19:02:45.327398+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
2014-05-02T19:02:45.327399+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/notifications.rb:159:in `block in instrument'
2014-05-02T19:02:45.327401+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
2014-05-02T19:02:45.327402+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/notifications.rb:159:in `instrument'
2014-05-02T19:02:45.327403+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
2014-05-02T19:02:45.327405+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
2014-05-02T19:02:45.327406+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
2014-05-02T19:02:45.327407+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/abstract_controller/base.rb:136:in `process'
2014-05-02T19:02:45.327408+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/abstract_controller/rendering.rb:44:in `process'
2014-05-02T19:02:45.327410+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_controller/metal.rb:195:in `dispatch'
2014-05-02T19:02:45.327419+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
2014-05-02T19:02:45.327420+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_controller/metal.rb:231:in `block in action'
2014-05-02T19:02:45.327422+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/routing/route_set.rb:80:in `call'
2014-05-02T19:02:45.327423+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
2014-05-02T19:02:45.327424+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/routing/route_set.rb:48:in `call'
2014-05-02T19:02:45.327425+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/routing/mapper.rb:44:in `call'
2014-05-02T19:02:45.327427+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/journey/router.rb:71:in `block in call'
2014-05-02T19:02:45.327428+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/journey/router.rb:59:in `each'
2014-05-02T19:02:45.327429+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/journey/router.rb:59:in `call'
2014-05-02T19:02:45.327431+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/routing/route_set.rb:674:in `call'
2014-05-02T19:02:45.327440+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-05-02T19:02:45.327441+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
2014-05-02T19:02:45.327443+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
2014-05-02T19:02:45.327448+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
2014-05-02T19:02:45.327450+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:25:in `call'
2014-05-02T19:02:45.327451+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
2014-05-02T19:02:45.327452+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
2014-05-02T19:02:45.327454+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/flash.rb:241:in `call'
2014-05-02T19:02:45.327455+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-05-02T19:02:45.327456+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-05-02T19:02:45.327457+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/cookies.rb:486:in `call'
2014-05-02T19:02:45.327459+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/query_cache.rb:36:in `call'
2014-05-02T19:02:45.327460+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
2014-05-02T19:02:45.327461+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
2014-05-02T19:02:45.327463+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/callbacks.rb:373:in `_run__286988594405397513__call__callbacks'
2014-05-02T19:02:45.327464+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/callbacks.rb:80:in `run_callbacks'
2014-05-02T19:02:45.327465+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2014-05-02T19:02:45.327467+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
2014-05-02T19:02:45.327468+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
2014-05-02T19:02:45.327469+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-05-02T19:02:45.327470+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:38:in `call_app'
2014-05-02T19:02:45.327472+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `block in call'
2014-05-02T19:02:45.327473+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2014-05-02T19:02:45.327474+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:26:in `tagged'
2014-05-02T19:02:45.327475+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `tagged'
2014-05-02T19:02:45.327476+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `call'
2014-05-02T19:02:45.327478+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-05-02T19:02:45.327479+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-05-02T19:02:45.327480+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-05-02T19:02:45.327481+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-05-02T19:02:45.327483+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-05-02T19:02:45.327486+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:511:in `call'
2014-05-02T19:02:45.327484+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-05-02T19:02:45.327487+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/application.rb:97:in `call'
2014-05-02T19:02:45.327488+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-05-02T19:02:45.327490+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-05-02T19:02:45.327491+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-05-02T19:02:45.327492+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-05-02T19:02:45.327493+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-05-02T19:02:45.327495+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-05-02T19:02:45.327496+00:00 app[web.1]:
2014-05-02T19:02:45.327497+00:00 app[web.1]:
2014-05-02T19:02:45.757831+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=dsctos.herokuapp.com request_id=f7890136-87aa-4567-b997-3307d229e262 fwd="200.104.29.32" dyno=web.1 connect=1ms service=5ms status=200 bytes=228
答案 0 :(得分:0)
试试这个:$ heroku logs | grep -i error
这将只返回有错误的heroku日志行。我建议研究出现的具体错误。
祝你好运答案 1 :(得分:0)
检查Heroku文档
heroku logs --tail --app app_name