2013-05-03 83 views
1

我无法正确查明究竟是什么导致问题 这是一个新网站,我刚推到heroku,跑heroku rake db:migrateheroku restart很抱歉,当用户尝试注册时,在heroku上出错了

它的工作原理只是在本地正常,但这种情况发生在生产 这里的Heroku的日志的相关部分

2013-05-03T23:16:27.189569+00:00 app[web.1]: 
2013-05-03T23:16:27.189569+00:00 app[web.1]: Started GET "/signup" for xx.xx.xx. 
xxx at 2013-05-03 23:16:27 +0000 
2013-05-03T23:16:27.253381+00:00 app[web.1]: Rendered shared/_error_messages.h 
tml.erb (0.4ms) 
2013-05-03T23:16:27.253381+00:00 app[web.1]: Rendered layouts/_shim.html.erb (
0.0ms) 
2013-05-03T23:16:27.253381+00:00 app[web.1]: Rendered layouts/_header.html.erb 
(2.9ms) 
2013-05-03T23:16:27.253381+00:00 app[web.1]: Processing by UsersController#new a 
s HTML 
2013-05-03T23:16:27.253381+00:00 app[web.1]: Rendered users/new.html.erb withi 
n layouts/application (43.8ms) 
2013-05-03T23:16:27.253381+00:00 app[web.1]: Completed 200 OK in 60ms (Views: 48 
.4ms | ActiveRecord: 1.6ms | Solr: 0.0ms) 
2013-05-03T23:16:27.922135+00:00 heroku[router]: at=info method=GET path=/favico 
n.ico host= sleepy-river-xxxx.herokuapp.com fwd="xx.xx.xx.xxx" dyno=web.1 connect 
=1ms service=4ms status=304 bytes=0 
2013-05-03T23:16:27.268937+00:00 heroku[router]: at=info method=GET path=/signup 
host= sleepy-river-xxxx.herokuapp.com fwd="xx.xx.xx.xxx" dyno=web.1 connect=6ms 
service=81ms status=304 bytes=0 
2013-05-03T23:16:47.934099+00:00 app[web.1]: 
2013-05-03T23:16:47.934099+00:00 app[web.1]: 
2013-05-03T23:16:47.934099+00:00 app[web.1]: Started POST "/users" for xx.xx.xx. 
xxx at 2013-05-03 23:16:47 +0000 
2013-05-03T23:16:48.248989+00:00 app[web.1]: Redirected to http://sleepy-river-xxxx.herokuapp.com/home 
2013-05-03T23:16:48.248989+00:00 app[web.1]: Parameters: {"utf8"=>"???", "auth 
enticity_token"=>"m+NCbnqHJk81yWgyY+Y709mQZ0N04MpW8MLGLXjbleA=", "user"=>{"name" 
=>"testuser", "email"=>"[email protected]", "password"=>"[FILTERED]", "passwo 
rd_confirmation"=>"[FILTERED]"}, "commit"=>"Create my account"} 
2013-05-03T23:16:48.248989+00:00 app[web.1]: Completed 302 Found in 311ms (Activ 
eRecord: 70.6ms) 
2013-05-03T23:16:48.248989+00:00 app[web.1]: Processing by UsersController#creat 
e as HTML 
2013-05-03T23:16:48.435265+00:00 app[web.1]: 
2013-05-03T23:16:48.435265+00:00 app[web.1]: 
2013-05-03T23:16:48.435265+00:00 app[web.1]: Started GET "/home" for 75.82.32.16 
4 at 2013-05-03 23:16:48 +0000 
2013-05-03T23:16:48.649331+00:00 app[web.1]:    FROM pg_attribute a L 
EFT JOIN pg_attrdef d 
2013-05-03T23:16:48.649331+00:00 app[web.1]:    WHERE a.attrelid = '"h 
ashtags"'::regclass 
2013-05-03T23:16:48.649331+00:00 app[web.1]: LINE 4:    WHERE a.attrel 
id = '"hashtags"'::regclass 
2013-05-03T23:16:48.649331+00:00 app[web.1]:     ON a.attrelid = d.a 
drelid AND a.attnum = d.adnum 
2013-05-03T23:16:48.649617+00:00 app[web.1]:  23: <%= link_to "#"+h.hashtag 
s, "#" %><br> 
2013-05-03T23:16:48.649617+00:00 app[web.1]:  25: 
2013-05-03T23:16:48.649845+00:00 app[web.1]: Rendered shared/_user_info.html.e 
rb (4.4ms) 
2013-05-03T23:16:48.649331+00:00 app[web.1]: ActionView::Template::Error (PGErro 
r: ERROR: relation "hashtags" does not exist 
2013-05-03T23:16:48.649617+00:00 app[web.1]:  22: <% @htags.each do |h| %> 
2013-05-03T23:16:48.649617+00:00 app[web.1]: 
2013-05-03T23:16:48.649845+00:00 app[web.1]: Processing by StaticPagesController 
#home as HTML 
2013-05-03T23:16:48.649331+00:00 app[web.1]: 
2013-05-03T23:16:48.649331+00:00 app[web.1]: 
    ^
2013-05-03T23:16:48.649331+00:00 app[web.1]: :    SELECT a.attname, for 
mat_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull 
2013-05-03T23:16:48.649617+00:00 app[web.1]: app/views/static_pages/home.html. 
erb:22:in `_app_views_static_pages_home_html_erb___3097102804728997358_70437520' 

2013-05-03T23:16:48.649845+00:00 app[web.1]: 
2013-05-03T23:16:48.649331+00:00 app[web.1]:    AND a.attnum > 0 AND 
NOT a.attisdropped 
2013-05-03T23:16:48.649331+00:00 app[web.1]:    ORDER BY a.attnum 
2013-05-03T23:16:48.649617+00:00 app[web.1]:  19: <div class="box"> 
2013-05-03T23:16:48.649617+00:00 app[web.1]:  24: <% end %> 
2013-05-03T23:16:48.649617+00:00 app[web.1]:): 
2013-05-03T23:16:48.649617+00:00 app[web.1]:  20: Tagged Posts 
2013-05-03T23:16:48.649617+00:00 app[web.1]:  21: <br> 
2013-05-03T23:16:48.649845+00:00 app[web.1]: Rendered shared/_stats.html.erb (
38.9ms) 
2013-05-03T23:16:48.649845+00:00 app[web.1]: Completed 500 Internal Server Error 
in 209ms 
2013-05-03T23:16:48.649845+00:00 app[web.1]: Rendered static_pages/home.html.e 
rb within layouts/application (156.1ms) 
2013-05-03T23:16:48.654562+00:00 heroku[router]: at=info method=GET path=/home h 
ost=sleepy-river-xxxx.herokuapp.com fwd="xx.xx.xx.xxx" dyno=web.1 connect=1ms se 
rvice=219ms status=500 bytes=643 
2013-05-03T23:16:48.253053+00:00 heroku[router]: at=info method=POST path=/users 
host= sleepy-river-xxxx.herokuapp.com fwd="xx.xx.xx.xxx" dyno=web.1 connect=3ms 
service=395ms status=302 bytes=109 
+0

你运行任何必要的数据库迁移将得到解决? – 2013-05-03 23:34:44

+0

我跑'heroku rake db:migrate'应该足够了。我应该尝试运行其他的东西吗? – user2131 2013-05-03 23:35:34

+0

错误似乎是在数据库方面给出的错误'PGErro r:错误:关系“hashtags”不存在'。你确定你的生产数据库模式符合开发吗? – 2013-05-03 23:38:40

回答

0

某处有问题,这是一个用户注册后加载的模板。在本地尝试,我敢打赌你会找到你需要的答案。

新增提示:

看行​​。这是你问题的关键。

我敢打赌,如果你运行

heroku run rake db:setup 

heroku run rake db:migrate 

你的问题

+0

我只是在本地尝试它,它的工作,所以这只发生在heroku生产 – user2131 2013-05-03 23:36:32

+0

我看到错误'关系HashTags不存在',我已经有了我的schema.db中的“Hashtags”表,一切工作正常,但本地在生产中 – user2131 2013-05-03 23:39:10

+0

运行'heroku run rake db:setup' – OneChillDude 2013-05-03 23:39:36