0

Rails プロジェクトを heroku にプッシュしたところ、Web アドレスにアクセスしようとすると「申し訳ありませんが、問題が発生しました。」というエラーが表示されます。heroku run rake db:migrateプロジェクトをアップロードした直後に行いました。誰かが問題が何であるか知っていますか?

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">

ログの少し下に、別のエラーが表示されます。

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'
4

1 に答える 1

2

Heroku はデータベースに postgresql を使用します。 DATETIME は postgres がサポートする関数ではありません。開発環境で同じバージョンの postgresql データベースをセットアップする必要があります。どのOSを使用していますか?Windowsの場合、その回答を書きました(一部はLinuxを実行している場合でも適用できます)。

于 2013-07-07T22:37:01.257 に答える