2013-07-07 2 views
0

방금 ​​전 헤로큐 프로젝트를 추진했지만 "죄송하지만 뭔가 잘못되었습니다."- 시도 할 때 오류가 발생합니다. 웹 주소를 방문하십시오. 프로젝트를 업로드 한 직후에 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' 

답변

2

에게 Heroku는 데이터베이스 PostgreSQL을 사용합니다. DATETIME is not a function postgres supports. 개발 환경에서 같은 버전의 postgresql 데이터베이스를 설정해야합니다. 어떤 OS를 사용하고 있습니까? 창문이 있다면, 나는 any answer for that이라고 썼다. (그것들 중 일부는 리눅스를 사용한다고해도 적용 가능하다.)

+0

고마워, 나는 이제 postgres localy로 변환했지만 아직 db : migrate 명령을 실행하지 않았다. 내가'db/migrate /'에있는 파일들에 들어가서'datetime'을'timestamp'으로 바꾸면 (왜냐하면 그것이 pg가 사용하기 때문입니다)? 마이그레이션하기 전에이 작업을 수행 할 수 있습니까? – allegutta

+0

@allegutta 아주 좋은 질문이지만 꼭 할 필요는 없습니다. postgres 데이터베이스 어댑터 (gemfile에있는'pg' 보석)는'datetime'을'timestamp'로 변환하는 것을 알게 될 것입니다. 행운을 빈다. 붙잡 힐 경우 더 이상 질문하지 말고. – AJP

+0

그게 전부! 도와 주셔서 감사합니다 @AJP! – allegutta

관련 문제