简体   繁体   English

Heroku上的Rails项目:“我们很抱歉,但出了点问题”

[英]Rails project on Heroku: “We're sorry, but something went wrong”

I have just pushed a rails project to heroku, but I get the "We're sorry, but something went wrong."-error when I try to visit the web address. 我刚刚将一个rails项目推送到了heroku,但我得到了“我们很抱歉,但出了点问题。” - 当我尝试访问网址时出错。 I did heroku run rake db:migrate just after I uploaded the project. 我上传项目后,我做了heroku run rake db:migrate Does someone know what the issue might be? 有人知道问题可能是什么吗?

2013-07-07T03:18:40.493412+00:00 heroku[web.1]: State changed from starting to up
2013-07-07T03:19:30.121757+00:00 app[web.1]: => Booting WEBrick
2013-07-07T03:19:30.121757+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:7276
2013-07-07T03:19:30.121757+00:00 app[web.1]: => Call with -d to detach
2013-07-07T03:19:30.121757+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-07-07T03:19:30.121757+00:00 app[web.1]: Started GET "/" for 216.15.124.94 at 2013-07-07 03:19:30 +0000
2013-07-07T03:19:30.298842+00:00 app[web.1]: Processing by PagesController#lelist as HTML
2013-07-07T03:19:30.683128+00:00 app[web.1]: Completed 500 Internal Server Error in 384ms
2013-07-07T03:19:30.680391+00:00 app[web.1]:   Rendered pages/_singlePost.html.erb (39.1ms)
2013-07-07T03:19:30.687518+00:00 app[web.1]:     1: <% @posts.each do |p| %>
2013-07-07T03:19:30.682956+00:00 app[web.1]:   Rendered pages/lelist.html.erb within layouts/application (122.9ms)
2013-07-07T03:19:30.687518+00:00 app[web.1]:     3:     <div class="span6 offset3">
2013-07-07T03:19:30.687741+00:00 app[web.1]:   app/views/pages/_singlePost.html.erb:1:in `_app_views_pages__single_ost_html_erb___4229188597617574554_47615640'
2013-07-07T03:19:30.687741+00:00 app[web.1]: 
2013-07-07T03:19:30.687518+00:00 app[web.1]:     4:         <div class="thumbnail">
2013-07-07T03:19:30.687741+00:00 app[web.1]:   app/views/pages/lelist.html.erb:22:in `_app_views_pages_lelist_html_erb___4165065758361537325_47142940'
2013-07-07T03:19:30.687518+00:00 app[web.1]: LINE 1: SELECT  "posts".* FROM "posts"  WHERE (DATETIME(created_at) ...
2013-07-07T03:19:30.687518+00:00 app[web.1]: : SELECT  "posts".* FROM "posts"  WHERE (DATETIME(created_at) <= DATETIME('2013-07-07 03:19:30.364173')) ORDER BY created_at DESC LIMIT 10 OFFSET 0):
2013-07-07T03:19:30.687518+00:00 app[web.1]: HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
2013-07-07T03:19:30.687741+00:00 app[web.1]: 
2013-07-07T03:19:30.687518+00:00 app[web.1]: 
2013-07-07T03:19:30.687518+00:00 app[web.1]: ActionView::Template::Error (PGError: ERROR:  function datetime(timestamp without time zone) does not exist
2013-07-07T03:19:30.687518+00:00 app[web.1]:     2: <div class="row">

A little further down in the log I get another error: 在日志中稍微下来我得到另一个错误:

2013-07-07T03:35:54.804738+00:00 app[web.1]: ActionView::Template::Error (PGError: ERROR:  function datetime(timestamp without time zone) does not exist
2013-07-07T03:35:54.804738+00:00 app[web.1]: LINE 1: SELECT  "posts".* FROM "posts"  WHERE (DATETIME(created_at) ...
2013-07-07T03:35:54.804738+00:00 app[web.1]:                                                ^
2013-07-07T03:35:54.804738+00:00 app[web.1]: HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
2013-07-07T03:35:54.804738+00:00 app[web.1]: : SELECT  "posts".* FROM "posts"  WHERE (DATETIME(created_at) <= DATETIME('2013-07-07 03:35:54.572183')) ORDER BY created_at DESC LIMIT 10 OFFSET 0):
2013-07-07T03:35:54.804738+00:00 app[web.1]:     1: <% @posts.each do |p| %>
2013-07-07T03:35:54.804738+00:00 app[web.1]:     4:         <div class="thumbnail">
2013-07-07T03:35:54.804738+00:00 app[web.1]:     2: <div class="row">
2013-07-07T03:35:54.804738+00:00 app[web.1]:     3:     <div class="span6 offset3">
2013-07-07T03:35:54.804934+00:00 app[web.1]:   app/views/pages/_singlePost.html.erb:1:in `_app_views_pages__single_ost_html_erb___4229188597617574554_47615640'
2013-07-07T03:35:54.804934+00:00 app[web.1]:   app/views/pages/lelist.html.erb:22:in `_app_views_pages_lelist_html_erb___4165065758361537325_47142940'

Heroku uses postgresql for your database. Heroku使用postgresql作为您的数据库。 DATETIME is not a function postgres supports . DATETIME不是postgres支持的功能 You should set up a postgresql database of the same version in your development environment. 您应该在开发环境中设置相同版本的postgresql数据库。 What OS are you on? 你在用什么操作系统? If windows, I wrote any answer for that (some of it is applicable even if you're running linux). 如果是windows,我为此写了任何答案 (即使你正在运行linux 其中一些也适用)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM