我正在尝试在heroku上加载一个应用程序(catarse),但是我有以下问题:应用程序确实部署了,虽然有一些警告,但是当我尝试访问应用程序时,我得到的只是一个空页面。
我做错了什么?
这里是我从heroku日志中得到的:
2015-07-21T08:36:01.404964+00:00 app[web.1]: PG::UndefinedTable: ERROR: relation "settings" does not exist
2015-07-21T08:36:01.404968+00:00 app[web.1]: ^
2015-07-21T08:36:01.404969+00:00 app[web.1]: : SELECT a.attname, format_type(a.atttypid, a.atttypmod),
2015-07-21T08:36:01.404966+00:00 app[web.1]: LINE 5: WHERE a.attrelid = '"settings"'::regclass
2015-07-21T08:36:01.404971+00:00 app[web.1]: pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
2015-07-21T08:36:01.404972+00:00 app[web.1]: FROM pg_attribute a LEFT JOIN pg_attrdef d
2015-07-21T08:36:01.404991+00:00 app[web.1]: ON a.attrelid = d.adrelid AND a.attnum = d.adnum
2015-07-21T08:36:01.404993+00:00 app[web.1]: WHERE a.attrelid = '"settings"'::regclass
2015-07-21T08:36:01.404994+00:00 app[web.1]: AND a.attnum > 0 AND NOT a.attisdropped
2015-07-21T08:36:01.404995+00:00 app[web.1]: ORDER BY a.attnum
2015-07-21T08:36:01.404996+00:00 app[web.1]:
2015-07-21T08:36:01.406117+00:00 app[web.1]: PG::UndefinedTable: ERROR: relation "settings" does not exist
2015-07-21T08:36:01.406119+00:00 app[web.1]: LINE 5: WHERE a.attrelid = '"settings"'::regclass
2015-07-21T08:36:01.406120+00:00 app[web.1]: ^
2015-07-21T08:36:01.406127+00:00 app[web.1]: WHERE a.attrelid = '"settings"'::regclass
2015-07-21T08:36:01.406129+00:00 app[web.1]: AND a.attnum > 0 AND NOT a.attisdropped
2015-07-21T08:36:01.406123+00:00 app[web.1]: pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
2015-07-21T08:36:01.406126+00:00 app[web.1]: ON a.attrelid = d.adrelid AND a.attnum = d.adnum
2015-07-21T08:36:01.406130+00:00 app[web.1]: ORDER BY a.attnum
2015-07-21T08:36:01.406132+00:00 app[web.1]:
2015-07-21T08:36:01.406122+00:00 app[web.1]: : SELECT a.attname, format_type(a.atttypid, a.atttypmod),
2015-07-21T08:36:01.406125+00:00 app[web.1]: FROM pg_attribute a LEFT JOIN pg_attrdef d
2015-07-21T08:36:01.466772+00:00 app[web.1]: PG::UndefinedTable: ERROR: relation "settings" does not exist
2015-07-21T08:36:01.466779+00:00 app[web.1]: LINE 5: WHERE a.attrelid = '"settings"'::regclass
2015-07-21T08:36:01.466781+00:00 app[web.1]: ^
2015-07-21T08:36:01.466782+00:00 app[web.1]: : SELECT a.attname, format_type(a.atttypid, a.atttypmod),
2015-07-21T08:36:01.466786+00:00 app[web.1]: FROM pg_attribute a LEFT JOIN pg_attrdef d
2015-07-21T08:36:01.466784+00:00 app[web.1]: pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
2015-07-21T08:36:01.466787+00:00 app[web.1]: ON a.attrelid = d.adrelid AND a.attnum = d.adnum
2015-07-21T08:36:01.466790+00:00 app[web.1]: AND a.attnum > 0 AND NOT a.attisdropped
2015-07-21T08:36:01.466789+00:00 app[web.1]: WHERE a.attrelid = '"settings"'::regclass
2015-07-21T08:36:01.466792+00:00 app[web.1]: ORDER BY a.attnum
2015-07-21T08:36:01.466793+00:00 app[web.1]:
2015-07-21T08:36:03.067206+00:00 heroku[web.1]: State changed from starting to up
2015-07-21T08:36:02.896912+00:00 app[web.1]: ** [NewRelic][07/21/15 08:36:02 +0000 web.1 (3)] INFO : Doing deferred dependency-detection before Rack startup
2015-07-21T08:36:02.898848+00:00 app[web.1]: ** [NewRelic][07/21/15 08:36:02 +0000 web.1 (3)] INFO : Installing ActiveRecord 4 instrumentation
2015-07-21T08:36:02.898952+00:00 app[web.1]: ** [NewRelic][07/21/15 08:36:02 +0000 web.1 (3)] INFO : Installing Sidekiq instrumentation
2015-07-21T08:36:02.899089+00:00 app[web.1]: ** [NewRelic][07/21/15 08:36:02 +0000 web.1 (3)] INFO : Installing HTTPClient instrumentation
2015-07-21T08:36:02.900263+00:00 app[web.1]: ** [NewRelic][07/21/15 08:36:02 +0000 web.1 (3)] INFO : Installing Rails 3+ middleware instrumentation
2015-07-21T08:36:02.903339+00:00 app[web.1]: I, [2015-07-21T08:36:02.903271 #3] INFO -- : listening on addr=0.0.0.0:57350 fd=10
2015-07-21T08:36:03.008821+00:00 app[web.1]: I, [2015-07-21T08:36:03.008512 #10] INFO -- : worker=1 ready
2015-07-21T08:36:03.055947+00:00 app[web.1]: I, [2015-07-21T08:36:03.055706 #13] INFO -- : worker=2 ready
2015-07-21T08:36:02.897141+00:00 app[web.1]: ** [NewRelic][07/21/15 08:36:02 +0000 web.1 (3)] INFO : Installing Curb instrumentation
2015-07-21T08:36:02.901567+00:00 app[web.1]: ** [NewRelic][07/21/15 08:36:02 +0000 web.1 (3)] INFO : Installing middleware-based Excon instrumentation
2015-07-21T08:36:02.962127+00:00 app[web.1]: I, [2015-07-21T08:36:02.961807 #7] INFO -- : worker=0 ready
2015-07-21T08:36:03.052324+00:00 app[web.1]: I, [2015-07-21T08:36:03.052081 #3] INFO -- : master process ready
2015-07-21T08:36:36.604049+00:00 heroku[router]: at=info method=GET path="/" host=catmeme.herokuapp.com request_id=0e235063-cfd8-4bd7-9e98-73049054ede7 fwd="145.107.164.184" dyno=web.1 connect=1ms service=43ms status=500 bytes=38
2015-07-21T08:36:36.601524+00:00 app[web.1]: E, [2015-07-21T08:36:36.601422 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/application.rb:482:in `validate_secret_key_config!'
2015-07-21T08:36:36.601582+00:00 app[web.1]: E, [2015-07-21T08:36:36.601512 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/application.rb:195:in `env_config'
2015-07-21T08:36:36.601627+00:00 app[web.1]: E, [2015-07-21T08:36:36.601583 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/engine.rb:510:in `call'
2015-07-21T08:36:36.601675+00:00 app[web.1]: E, [2015-07-21T08:36:36.601625 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/application.rb:144:in `call'
2015-07-21T08:36:36.601957+00:00 app[web.1]: E, [2015-07-21T08:36:36.601673 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/railtie.rb:194:in `public_send'
2015-07-21T08:36:36.601985+00:00 app[web.1]: E, [2015-07-21T08:36:36.601948 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/railtie.rb:194:in `method_missing'
2015-07-21T08:36:36.602015+00:00 app[web.1]: E, [2015-07-21T08:36:36.601982 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
2015-07-21T08:36:36.602046+00:00 app[web.1]: E, [2015-07-21T08:36:36.602012 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.0.288/lib/new_relic/rack/developer_mode.rb:48:in `traced_call'
2015-07-21T08:36:36.601314+00:00 app[web.1]: E, [2015-07-21T08:36:36.601197 #7] ERROR -- : app error: Missing `secret_token` and `secret_key_base` for 'production' environment, set these values in `config/secrets.yml` (RuntimeError)
2015-07-21T08:36:36.602076+00:00 app[web.1]: E, [2015-07-21T08:36:36.602043 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
2015-07-21T08:36:36.602112+00:00 app[web.1]: E, [2015-07-21T08:36:36.602073 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:580:in `process_client'
2015-07-21T08:36:36.602149+00:00 app[web.1]: E, [2015-07-21T08:36:36.602111 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:674:in `worker_loop'
2015-07-21T08:36:36.602196+00:00 app[web.1]: E, [2015-07-21T08:36:36.602146 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:529:in `spawn_missing_workers'
2015-07-21T08:36:36.602246+00:00 app[web.1]: E, [2015-07-21T08:36:36.602194 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:140:in `start'
2015-07-21T08:36:36.602295+00:00 app[web.1]: E, [2015-07-21T08:36:36.602244 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/bin/unicorn_rails:209:in `<top (required)>'
2015-07-21T08:36:36.602342+00:00 app[web.1]: E, [2015-07-21T08:36:36.602292 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/bin/unicorn_rails:23:in `load'
2015-07-21T08:36:36.602387+00:00 app[web.1]: E, [2015-07-21T08:36:36.602339 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/bin/unicorn_rails:23:in `<main>'
2015-07-21T08:36:36.877794+00:00 app[web.1]: ** [NewRelic][07/21/15 08:36:36 +0000 web.1 (7)] INFO : Reporting to: https://rpm.newrelic.com/accounts/1048373/applications/6949804
2015-07-21T08:36:37.017048+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=catmeme.herokuapp.com request_id=15f8d716-0d98-4eb3-863e-1d8fabbfa8ae fwd="145.107.164.184" dyno=web.1 connect=1ms service=4ms status=500 bytes=38
2015-07-21T08:36:37.017265+00:00 app[web.1]: E, [2015-07-21T08:36:37.017191 #7] ERROR -- : app error: Missing `secret_token` and `secret_key_base` for 'production' environment, set these values in `config/secrets.yml` (RuntimeError)
2015-07-21T08:36:37.017328+00:00 app[web.1]: E, [2015-07-21T08:36:37.017251 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/application.rb:482:in `validate_secret_key_config!'
2015-07-21T08:36:37.017382+00:00 app[web.1]: E, [2015-07-21T08:36:37.017326 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/application.rb:195:in `env_config'
2015-07-21T08:36:37.017431+00:00 app[web.1]: E, [2015-07-21T08:36:37.017380 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/engine.rb:510:in `call'
2015-07-21T08:36:37.017481+00:00 app[web.1]: E, [2015-07-21T08:36:37.017429 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/application.rb:144:in `call'
2015-07-21T08:36:37.017528+00:00 app[web.1]: E, [2015-07-21T08:36:37.017479 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/railtie.rb:194:in `public_send'
2015-07-21T08:36:37.017713+00:00 app[web.1]: E, [2015-07-21T08:36:37.017527 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/railtie.rb:194:in `method_missing'
2015-07-21T08:36:37.017749+00:00 app[web.1]: E, [2015-07-21T08:36:37.017712 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
2015-07-21T08:36:37.017780+00:00 app[web.1]: E, [2015-07-21T08:36:37.017747 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.0.288/lib/new_relic/rack/developer_mode.rb:48:in `traced_call'
2015-07-21T08:36:37.017811+00:00 app[web.1]: E, [2015-07-21T08:36:37.017778 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
2015-07-21T08:36:37.017843+00:00 app[web.1]: E, [2015-07-21T08:36:37.017809 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:580:in `process_client'
2015-07-21T08:36:37.017874+00:00 app[web.1]: E, [2015-07-21T08:36:37.017841 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:674:in `worker_loop'
2015-07-21T08:36:37.017920+00:00 app[web.1]: E, [2015-07-21T08:36:37.017872 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:529:in `spawn_missing_workers'
2015-07-21T08:36:37.017968+00:00 app[web.1]: E, [2015-07-21T08:36:37.017919 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:140:in `start'
2015-07-21T08:36:37.018001+00:00 app[web.1]: E, [2015-07-21T08:36:37.017966 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/bin/unicorn_rails:209:in `<top (required)>'
2015-07-21T08:36:37.018077+00:00 app[web.1]: E, [2015-07-21T08:36:37.018029 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/bin/unicorn_rails:23:in `<main>'
2015-07-21T08:36:37.018032+00:00 app[web.1]: E, [2015-07-21T08:36:37.017999 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/bin/unicorn_rails:23:in `load'
2015-07-21T08:36:41.316634+00:00 heroku[router]: at=info method=GET path="/" host=catmeme.herokuapp.com request_id=436df0bb-c213-4847-8eb7-938c9f6dacdc fwd="145.107.164.184" dyno=web.1 connect=1ms service=4ms status=500 bytes=38
2015-07-21T08:36:41.310112+00:00 app[web.1]: E, [2015-07-21T08:36:41.310002 #7] ERROR -- : app error: Missing `secret_token` and `secret_key_base` for 'production' environment, set these values in `config/secrets.yml` (RuntimeError)
2015-07-21T08:36:41.310147+00:00 app[web.1]: E, [2015-07-21T08:36:41.310086 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/application.rb:482:in `validate_secret_key_config!'
2015-07-21T08:36:41.310245+00:00 app[web.1]: E, [2015-07-21T08:36:41.310194 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/engine.rb:510:in `call'
2015-07-21T08:36:41.310342+00:00 app[web.1]: E, [2015-07-21T08:36:41.310292 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/railtie.rb:194:in `public_send'
2015-07-21T08:36:41.310390+00:00 app[web.1]: E, [2015-07-21T08:36:41.310341 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/railtie.rb:194:in `method_missing'
2015-07-21T08:36:41.310197+00:00 app[web.1]: E, [2015-07-21T08:36:41.310144 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/application.rb:195:in `env_config'
2015-07-21T08:36:41.310293+00:00 app[web.1]: E, [2015-07-21T08:36:41.310243 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/railties-4.1.11/lib/rails/application.rb:144:in `call'
2015-07-21T08:36:41.310439+00:00 app[web.1]: E, [2015-07-21T08:36:41.310389 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
2015-07-21T08:36:41.310487+00:00 app[web.1]: E, [2015-07-21T08:36:41.310437 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.0.288/lib/new_relic/rack/developer_mode.rb:48:in `traced_call'
2015-07-21T08:36:41.310535+00:00 app[web.1]: E, [2015-07-21T08:36:41.310486 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
2015-07-21T08:36:41.310583+00:00 app[web.1]: E, [2015-07-21T08:36:41.310534 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:580:in `process_client'
2015-07-21T08:36:41.310644+00:00 app[web.1]: E, [2015-07-21T08:36:41.310581 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:674:in `worker_loop'
2015-07-21T08:36:41.310694+00:00 app[web.1]: E, [2015-07-21T08:36:41.310642 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:529:in `spawn_missing_workers'
2015-07-21T08:36:41.310727+00:00 app[web.1]: E, [2015-07-21T08:36:41.310691 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:140:in `start'
2015-07-21T08:36:41.310772+00:00 app[web.1]: E, [2015-07-21T08:36:41.310724 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/gems/unicorn-4.9.0/bin/unicorn_rails:209:in `<top (required)>'
2015-07-21T08:36:41.310805+00:00 app[web.1]: E, [2015-07-21T08:36:41.310770 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/bin/unicorn_rails:23:in `load'
2015-07-21T08:36:41.310850+00:00 app[web.1]: E, [2015-07-21T08:36:41.310802 #7] ERROR -- : /app/vendor/bundle/ruby/2.2.0/bin/unicorn_rails:23:in `<main>'
答案 0 :(得分:1)
所有错误都在日志中。
2015-07-21T08:36:36.601314 + 00:00 app [web.1]:E, [2015-07-21T08:36:36.601197#7]错误 - :应用程序错误:丢失 设置为{生产'环境的
中secret_token
和secret_key_base
这些值在config/secrets.yml
(RuntimeError)
您应该在config / secrets.yml文件中添加以下行:
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
(小心缩进)
另外,请确保在您的环境变量中(在您的应用程序的heroku仪表板上可见 - > gt;设置 - &gt;显示配置变量),变量SECRET_KEY_BASE
存在。
你应该在这里找到一些关于如何使用Heroku管理秘密令牌的好信息:http://daniel.fone.net.nz/blog/2013/05/20/a-better-way-to-manage-the-rails-secret-token/