将rails应用程序推送到heroku时遇到了麻烦

时间:2014-05-03 17:40:21

标签: ruby-on-rails heroku ruby-on-rails-4

我关注了如何将新应用推向Heroku的Michael Hartl的rails教程。一切都运行良好,但是当我在命令行中键入heroku时,它会显示

我们很抱歉,但出了点问题。

如果您是应用程序所有者,请检查日志以获取更多信息。

我的日志是

2014-05-03T17:34:47.920104+00:00 heroku[web.1]: Process exited with status 143
2014-05-03T17:35:22.663520+00:00 app[web.1]: => Booting WEBrick
2014-05-03T17:35:22.663525+00:00 app[web.1]: => Rails 4.0.4 application starting
 in production on http://0.0.0.0:37068
2014-05-03T17:35:22.663527+00:00 app[web.1]: => Run `rails server -h` for more s
tartup options
2014-05-03T17:35:22.663529+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-05-03T17:35:22.663536+00:00 app[web.1]: Started GET "/" for 76.103.13.109 a
t 2014-05-03 17:35:22 +0000
2014-05-03T17:35:22.663531+00:00 app[web.1]: Started GET "/" for 76.103.13.109 a
t 2014-05-03 17:35:22 +0000
2014-05-03T17:35:23.077863+00:00 heroku[router]: at=info method=GET path=/ host=
guarded-cove-8209.herokuapp.com request_id=ad1779bd-68f1-4676-836d-76463fde764c
fwd="76.103.13.109" dyno=web.1 connect=1ms service=417ms status=500 bytes=1543
2014-05-03T17:35:23.071079+00:00 app[web.1]: : SELECT "posts".* FROM "posts"
2014-05-03T17:35:23.025427+00:00 app[web.1]: Processing by PostsController#index
 as HTML
2014-05-03T17:35:23.025436+00:00 app[web.1]: Processing by PostsController#index
 as HTML
2014-05-03T17:35:23.071066+00:00 app[web.1]: PG::Error: ERROR:  relation "posts"
 does not exist
2014-05-03T17:35:23.071081+00:00 app[web.1]: PG::Error: ERROR:  relation "posts"
 does not exist
2014-05-03T17:35:23.071085+00:00 app[web.1]:                               ^
2014-05-03T17:35:23.071083+00:00 app[web.1]: LINE 1: SELECT "posts".* FROM "post
s"
2014-05-03T17:35:23.071073+00:00 app[web.1]: LINE 1: SELECT "posts".* FROM "post
s"
2014-05-03T17:3
5:23.071077+00:00 app[web.1]:                               ^
2014-05-03T17:35:23.071087+00:00 app[web.1]: : SELECT "posts".* FROM "posts"
2014-05-03T17:35:23.071919+00:00 app[web.1]:   Rendered posts/index.html.erb wit
hin layouts/application (23.1ms)
2014-05-03T17:35:23.072195+00:00 app[web.1]: Completed 500 Internal Server Error
 in 47ms
2014-05-03T17:35:23.072199+00:00 app[web.1]: Completed 500 Internal Server Error
 in 47ms
2014-05-03T17:35:23.073997+00:00 app[web.1]:
2014-05-03T17:35:23.074001+00:00 app[web.1]: ActionView::Template::Error (PG::Er
ror: ERROR:  relation "posts" does not exist
2014-05-03T17:35:23.074002+00:00 app[web.1]: LINE 1: SELECT "posts".* FROM "post
s"
2014-05-03T17:35:23.074007+00:00 app[web.1]:     12:   </thead>
2014-05-03T17:35:23.074009+00:00 app[web.1]:     13:
2014-05-03T17:35:23.074010+00:00 app[web.1]:     14:   <tbody>
2014-05-03T17:35:23.071910+00:00 app[web.1]:   Rendered posts/index.html.erb wit
hin layouts/application (23.1ms)
2014-05-03T17:35:23.074004+00:00 app[web.1]:                               ^
2014-05-03T17:35:23.074006+00:00 app[web.1]: : SELECT "posts".* FROM "posts"):
2014-05-03T17:35:23.074012+00:00 app[web.1]:     15:     <% @posts.each do |post
| %>
2014-05-03T17:35:23.074014+00:00 app[web.1]:     16:       <tr>
2014-05-03T17:35:23.074015+00:00 app[web.1]:     17:         <td><%= post.title
%></td>
2014-05-03T17:35:23.074017+00:00 app[web.1]:     18:         <td><%= post.descri
ption %></td>
2014-05-03T17:35:23.074019+00:00 app[web.1]:   app/views/posts/index.html.erb:15
:in `_app_views_posts_index_html_erb___2066943025262415606_69837409687420'
2014-05-03T17:35:23.074020+00:00 app[web.1]:
2014-05-03T17:35:23.074021+00:00 app[web.1]:
2014-05-03T17:35:23.074070+00:00 app[web.1]:                               ^
2014-05-03T17:35:23.074072+00:00 app[web.1]: : SELECT "posts".* FROM "posts"):
2014-05-03T17:35:23.074065+00:00 app[web.1]:
2014-05-03T17:35:23.074067+00:00 app[web.1]: ActionView::Template::Error (PG::Er
ror: ERROR:  relation "posts" does not exist
2014-05-03T17:35:23.074069+00:00 app[web.1]: LINE 1: SELECT "posts".* FROM "post
s"
2014-05-03T17:35:23.074073+00:00 app[web.1]:     12:   </thead>
2014-05-03T17:35:23.074074+00:00 app[web.1]:     13:
2014-05-03T17:35:23.074076+00:00 app[web.1]:     14:   <tbody>
2014-05-03T17:35:23.074077+00:00 app[web.1]:     15:     <% @posts.each do |post
| %>
2014-05-03T17:35:23.074079+00:00 app[web.1]:     16:       <tr>
2014-05-03T17:35:23.074084+00:00 app[web.1]:   app/views/posts/index.html.erb:15
:in `_app_views_posts_index_html_erb___2066943025262415606_69837409687420'
2014-05-03T17:35:23.074081+00:00 app[web.1]:     17:         <td><%= post.title
%></td>
2014-05-03T17:35:23.074082+00:00 app[web.1]:     18:         <td><%= post.descri
ption %></td>
2014-05-03T17:35:23.074085+00:00 app[web.1]:
2014-05-03T17:35:23.074087+00:00 app[web.1]:
2014-05-03T17:35:23.362755+00:00 heroku[router]: at=info method=GET path=/favico
n.ico host=guarded-cove-8209.herokuapp.com request_id=752c76ed-8d7e-47f9-8715-d6
de79ea66cc fwd="76.103.13.109" dyno=web.1 connect=2ms service=26ms status=304 by
tes=133
2014-05-03T17:38:18.600705+00:00 heroku[router]: at=info method=GET path=/ host=
guarded-cove-8209.herokuapp.com request_id=c59a9cd9-5715-4d6e-82ea-e32fb0284c79
fwd="76.103.13.109" dyno=web.1 connect=11ms service=39ms status=500 bytes=1543
2014-05-03T17:38:18.593201+00:00 app[web.1]: PG::Error: ERROR:  relation "posts"
 does not exist
2014-05-03T17:38:18.593210+00:00 app[web.1]: LINE 1: SELECT "posts".* FROM "post
s"
2014-05-03T17:38:18.561684+00:00 app[web.1]: Started GET "/" for 76.103.13.109 a
t 2014-05-03 17:38:18 +0000
2014-05-03T17:38:18.561696+00:00 app[web.1]: Started GET "/" for 76.103.13.109 a
t 2014-05-03 17:38:18 +0000
2014-05-03T17:38:18.565361+00:00 app[web.1]: Processing by PostsController#index
 as HTML
2014-05-03T17:38:18.565369+00:00 app[web.1]: Processing by PostsController#index
 as HTML
2014-05-03T17:38:18.593187+00:00 app[web.1]: PG::Error: ERROR:  relation "posts"
 does not exist
2014-05-03T17:38:18.593192+00:00 app[web.1]: LINE 1: SELECT "posts".* FROM "post
s"
2014-05-03T17:38:18.593194+00:00 app[web.1]:                               ^
2014-05-03T17:38:18.593195+00:00 app[web.1]: : SELECT "posts".* FROM "posts"
2014-05-03T17:38:18.593211+00:00 app[web.1]:                               ^
2014-05-03T17:38:18.593213+00:00 app[web.1]: : SELECT "posts".* FROM "posts"
2014-05-03T17:38:18.594446+00:00 app[web.1]:   Rendered posts/index.html.erb wit
hin layouts/application (28.1ms)
2014-05-03T17:38:18.594449+00:00 app[web.1]:   Rendered posts/index.html.erb wit
hin layouts/application (28.1ms)
2014-05-03T17:38:18.594644+00:00 app[web.1]: Completed 500 Internal Server Error
 in 29ms
2014-05-03T17:38:18.594652+00:00 app[web.1]: Completed 500 Internal Server Error
 in 29ms
2014-05-03T17:38:18.596408+00:00 app[web.1]:
2014-05-03T17:38:18.596411+00:00 app[web.1]: ActionView::Template::Error (PG::Er
ror: ERROR:  relation "posts" does not exist
2014-05-03T17:38:18.596413+00:00 app[web.1]: LINE 1: SELECT "posts".* FROM "post
s"
2014-05-03T17:38:18.596414+00:00 app[web.1]:                               ^
2014-05-03T17:38:18.596416+00:00 app[web.1]: : SELECT "posts".* FROM "posts"):
2014-05-03T17:38:18.596417+00:00 app[web.1]:     12:   </thead>
2014-05-03T17:38:18.596419+00:00 app[web.1]:     13:
2014-05-03T17:38:18.596421+00:00 app[web.1]:     14:   <tbody>
2014-05-03T17:38:18.596422+00:00 app[web.1]:     15:     <% @posts.each do |post
| %>
2014-05-03T17:38:18.596424+00:00 app[web.1]:     16:       <tr>
2014-05-03T17:38:18.596425+00:00 app[web.1]:     17:         <td><%= post.title
%></td>
2014-05-03T17:38:18.596427+00:00 app[web.1]:     18:         <td><%= post.descri
ption %></td>
2014-05-03T17:38:18.596429+00:00 app[web.1]:   app/views/posts/index.html.erb:15
:in `_app_views_posts_index_html_erb___2066943025262415606_69837409687420'
2014-05-03T17:38:18.596430+00:00 app[web.1]:
2014-05-03T17:38:18.596431+00:00 app[web.1]:
2014-05-03T17:38:18.596466+00:00 app[web.1]:
2014-05-03T17:38:18.596468+00:00 app[web.1]: ActionView::Template::Error (PG::Er
ror: ERROR:  relation "posts" does not exist
2014-05-03T17:38:18.596469+00:00 app[web.1]: LINE 1: SELECT "posts".* FROM "post
s"
2014-05-03T17:38:18.596471+00:00 app[web.1]:                               ^
2014-05-03T17:38:18.596472+00:00 app[web.1]: : SELECT "posts".* FROM "posts"):
2014-05-03T17:38:18.596473+00:00 app[web.1]:     12:   </thead>
2014-05-03T17:38:18.596475+00:00 app[web.1]:     13:
2014-05-03T17:38:18.596476+00:00 app[web.1]:     14:   <tbody>
2014-05-03T17:38:18.596478+00:00 app[web.1]:     15:     <% @posts.each do |post
| %>
2014-05-03T17:38:18.596479+00:00 app[web.1]:     16:       <tr>
2014-05-03T17:38:18.596481+00:00 app[web.1]:     17:         <td><%= post.title
%></td>
2014-05-03T17:38:18.596482+00:00 app[web.1]:     18:         <td><%= post.descri
ption %></td>
2014-05-03T17:38:18.596483+00:00 app[web.1]:   app/views/posts/index.html.erb:15
:in `_app_views_posts_index_html_erb___2066943025262415606_69837409687420'
2014-05-03T17:38:18.596485+00:00 app[web.1]:
2014-05-03T17:38:18.596486+00:00 app[web.1]:
2014-05-03T17:38:18.915862+00:00 heroku[router]: at=info method=GET path=/favico
n.ico host=guarded-cove-8209.herokuapp.com request_id=e8d4b7a1-4f4d-4251-a809-f7
c4b6098b2d fwd="76.103.13.109" dyno=web.1 connect=2ms service=4ms status=304 byt
es=133

1 个答案:

答案 0 :(得分:0)

当您推送到Heroku时,不会为您运行迁移 - 您需要自己运行

heroku run rake db:migrate