Heroku路线不起作用

时间:2012-08-29 22:28:54

标签: ruby-on-rails heroku routes

所以我的主要铁路模型是“公司”。当我在本地托管我的应用程序并导航到localhost:3000 /公司时,一切正常。但是当我导航到我的应用程序的heroku版本时:

http://calm-journey-2877.herokuapp.com/companies

..我收到错误“我们很抱歉,但出了点问题”

这表明该页面存在但产生某种错误..任何想法可能会发生什么?这是我通过阅读Rails教程书而构建的一个非常基本的应用程序。

谢谢!

编辑:

这是Heroku日志。

2012-08-29T22:20:54+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/connection.rb:38:in `receive_data'
2012-08-29T22:20:54+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/backends/base.rb:63:in `start'
2012-08-29T22:20:54+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
2012-08-29T22:20:54+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/server.rb:159:in `start'
2012-08-29T22:20:54+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
2012-08-29T22:20:54+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:185:in `run_command'
2012-08-29T22:20:54+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/controllers/controller.rb:86:in `start'
2012-08-29T22:20:54+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:151:in `run!'
2012-08-29T22:20:54+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/bin/thin:19:in `load'
2012-08-29T22:20:54+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/bin/thin:19:in `<main>'
2012-08-29T22:20:54+00:00 app[web.1]: 
2012-08-29T22:20:54+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/bin/thin:6:in `<top (required)>'
2012-08-29T22:20:54+00:00 app[web.1]: 
2012-08-29T22:20:54+00:00 heroku[router]: GET calm-journey-2877.herokuapp.com/clients dyno=web.1 queue=0 wait=0ms service=7ms status=404 bytes=728
2012-08-29T22:21:00+00:00 app[web.1]: 
2012-08-29T22:21:00+00:00 app[web.1]: 
2012-08-29T22:21:00+00:00 app[web.1]: Started GET "/companies" for 24.14.103.65 at 2012-08-29 22:21:00 +0000
2012-08-29T22:21:00+00:00 app[web.1]: Processing by CompaniesController#index as HTML
2012-08-29T22:21:00+00:00 app[web.1]: Completed 500 Internal Server Error in 7ms
2012-08-29T22:21:00+00:00 app[web.1]: 
2012-08-29T22:21:00+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::Error: ERROR:  relation "companies" does not exist
2012-08-29T22:21:00+00:00 app[web.1]: LINE 4:              WHERE a.attrelid = '"companies"'::regclass
2012-08-29T22:21:00+00:00 app[web.1]:                                         ^
2012-08-29T22:21:00+00:00 app[web.1]: :             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
2012-08-29T22:21:00+00:00 app[web.1]:               FROM pg_attribute a LEFT JOIN pg_attrdef d
2012-08-29T22:21:00+00:00 app[web.1]:                 ON a.attrelid = d.adrelid AND a.attnum = d.adnum
2012-08-29T22:21:00+00:00 app[web.1]:              WHERE a.attrelid = '"companies"'::regclass
2012-08-29T22:21:00+00:00 app[web.1]:                AND a.attnum > 0 AND NOT a.attisdropped
2012-08-29T22:21:00+00:00 app[web.1]:              ORDER BY a.attnum
2012-08-29T22:21:00+00:00 app[web.1]: ):
2012-08-29T22:21:00+00:00 app[web.1]:   app/controllers/companies_controller.rb:86:in `sort_column'
2012-08-29T22:21:00+00:00 app[web.1]:   app/controllers/companies_controller.rb:6:in `index'
2012-08-29T22:21:00+00:00 app[web.1]: 
2012-08-29T22:21:00+00:00 app[web.1]: 
2012-08-29T22:21:00+00:00 heroku[router]: GET calm-journey-2877.herokuapp.com/companies dyno=web.1 queue=0 wait=0ms service=13ms status=500 bytes=643
2012-08-29T22:21:00+00:00 heroku[router]: GET calm-journey-2877.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=3ms status=304 bytes=0
2012-08-29T22:27:31+00:00 app[web.1]: 
2012-08-29T22:27:31+00:00 app[web.1]: 
2012-08-29T22:27:31+00:00 app[web.1]: Started GET "/companies" for 24.14.103.65 at 2012-08-29 22:27:31 +0000
2012-08-29T22:27:31+00:00 app[web.1]: Processing by CompaniesController#index as HTML
2012-08-29T22:27:31+00:00 app[web.1]: Completed 500 Internal Server Error in 14ms
2012-08-29T22:27:31+00:00 app[web.1]: 
2012-08-29T22:27:31+00:00 app[web.1]: LINE 4:              WHERE a.attrelid = '"companies"'::regclass
2012-08-29T22:27:31+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::Error: ERROR:  relation "companies" does not exist
2012-08-29T22:27:31+00:00 app[web.1]:                                         ^
2012-08-29T22:27:31+00:00 app[web.1]: :             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
2012-08-29T22:27:31+00:00 app[web.1]:               FROM pg_attribute a LEFT JOIN pg_attrdef d
2012-08-29T22:27:31+00:00 app[web.1]:              WHERE a.attrelid = '"companies"'::regclass
2012-08-29T22:27:31+00:00 app[web.1]:                 ON a.attrelid = d.adrelid AND a.attnum = d.adnum
2012-08-29T22:27:31+00:00 app[web.1]:                AND a.attnum > 0 AND NOT a.attisdropped
2012-08-29T22:27:31+00:00 app[web.1]:              ORDER BY a.attnum
2012-08-29T22:27:31+00:00 app[web.1]: ):
2012-08-29T22:27:31+00:00 app[web.1]:   app/controllers/companies_controller.rb:86:in `sort_column'
2012-08-29T22:27:31+00:00 app[web.1]:   app/controllers/companies_controller.rb:6:in `index'
2012-08-29T22:27:31+00:00 app[web.1]: 
2012-08-29T22:27:31+00:00 app[web.1]: 
2012-08-29T22:27:31+00:00 heroku[router]: GET calm-journey-2877.herokuapp.com/companies dyno=web.1 queue=0 wait=0ms service=42ms status=500 bytes=643
2012-08-29T22:27:31+00:00 heroku[router]: GET calm-journey-2877.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=3ms status=304 bytes=0
2012-08-29T22:29:13+00:00 app[web.1]: 
2012-08-29T22:29:13+00:00 app[web.1]: 
2012-08-29T22:29:13+00:00 app[web.1]: Started GET "/companies" for 24.14.103.65 at 2012-08-29 22:29:13 +0000
2012-08-29T22:29:13+00:00 app[web.1]: Processing by CompaniesController#index as HTML
2012-08-29T22:29:13+00:00 app[web.1]: Completed 500 Internal Server Error in 3ms
2012-08-29T22:29:13+00:00 app[web.1]: 
2012-08-29T22:29:13+00:00 app[web.1]: LINE 4:              WHERE a.attrelid = '"companies"'::regclass
2012-08-29T22:29:13+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::Error: ERROR:  relation "companies" does not exist
2012-08-29T22:29:13+00:00 app[web.1]: :             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
2012-08-29T22:29:13+00:00 app[web.1]:                                         ^
2012-08-29T22:29:13+00:00 app[web.1]:              WHERE a.attrelid = '"companies"'::regclass
2012-08-29T22:29:13+00:00 app[web.1]:               FROM pg_attribute a LEFT JOIN pg_attrdef d
2012-08-29T22:29:13+00:00 app[web.1]:                 ON a.attrelid = d.adrelid AND a.attnum = d.adnum
2012-08-29T22:29:13+00:00 app[web.1]:                AND a.attnum > 0 AND NOT a.attisdropped
2012-08-29T22:29:13+00:00 app[web.1]:              ORDER BY a.attnum
2012-08-29T22:29:13+00:00 app[web.1]: ):
2012-08-29T22:29:13+00:00 app[web.1]:   app/controllers/companies_controller.rb:6:in `index'
2012-08-29T22:29:13+00:00 app[web.1]:   app/controllers/companies_controller.rb:86:in `sort_column'
2012-08-29T22:29:13+00:00 app[web.1]: 
2012-08-29T22:29:13+00:00 app[web.1]: 
2012-08-29T22:29:13+00:00 heroku[router]: GET calm-journey-2877.herokuapp.com/companies dyno=web.1 queue=0 wait=0ms service=10ms status=500 bytes=643
2012-08-29T22:33:52+00:00 app[web.1]: 
2012-08-29T22:33:52+00:00 app[web.1]: 
2012-08-29T22:33:52+00:00 app[web.1]: Started GET "/companies" for 186.147.240.150 at 2012-08-29 22:33:52 +0000
2012-08-29T22:33:52+00:00 app[web.1]: Processing by CompaniesController#index as HTML
2012-08-29T22:33:52+00:00 app[web.1]: Completed 500 Internal Server Error in 3ms
2012-08-29T22:33:52+00:00 app[web.1]: 
2012-08-29T22:33:52+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::Error: ERROR:  relation "companies" does not exist
2012-08-29T22:33:52+00:00 app[web.1]: LINE 4:              WHERE a.attrelid = '"companies"'::regclass
2012-08-29T22:33:52+00:00 app[web.1]:                                         ^
2012-08-29T22:33:52+00:00 app[web.1]:               FROM pg_attribute a LEFT JOIN pg_attrdef d
2012-08-29T22:33:52+00:00 app[web.1]: :             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
2012-08-29T22:33:52+00:00 app[web.1]:                 ON a.attrelid = d.adrelid AND a.attnum = d.adnum
2012-08-29T22:33:52+00:00 app[web.1]:              WHERE a.attrelid = '"companies"'::regclass
2012-08-29T22:33:52+00:00 app[web.1]: 
2012-08-29T22:33:52+00:00 app[web.1]:              ORDER BY a.attnum
2012-08-29T22:33:52+00:00 app[web.1]:   app/controllers/companies_controller.rb:86:in `sort_column'
2012-08-29T22:33:52+00:00 app[web.1]:                AND a.attnum > 0 AND NOT a.attisdropped
2012-08-29T22:33:52+00:00 app[web.1]: ):
2012-08-29T22:33:52+00:00 app[web.1]:   app/controllers/companies_controller.rb:6:in `index'
2012-08-29T22:33:52+00:00 app[web.1]: 
2012-08-29T22:33:52+00:00 heroku[router]: GET calm-journey-2877.herokuapp.com/companies dyno=web.1 queue=0 wait=0ms service=10ms status=500 bytes=643
2012-08-29T22:33:52+00:00 heroku[router]: GET calm-journey-2877.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=4ms status=200 bytes=0

2 个答案:

答案 0 :(得分:1)

您是否在Heroku heroku run rake db:migrate中迁移了数据库?

答案 1 :(得分:0)

你的解决方案在git中休息。编写你的rake任务并确保它在你的git存储库中。

比尝试     Heroku运行rake your_task

或者将您的DB种子文件用于其预期目的。