2012-10-29 44 views
0

我在將我的rails應用程序部署到heroku時遇到問題。我只是修復了一個錯誤Rails + Heroku : We're sorry, but something went wrong,但我想還有更多。任何人都可以幫助指導我如何調試它?我被卡住了,因爲heroku沒有告訴我錯誤發生在哪一行。對不起,麻煩了。Rails + Heroku:ActionView :: Template :: Error

這是我所有的代碼,如果你想看看。 https://github.com/EdmundMai/pholderbeta

讓我知道你是否希望我粘貼任何東西。

Heroku的日誌:

2012-10-29T16:43:41+00:00 app[web.1]: Completed 500 Internal Server Error in 328ms 
2012-10-29T16:43:41+00:00 app[web.1]: 
2012-10-29T16:43:41+00:00 app[web.1]: LINE 4:    WHERE a.attrelid = '"users"'::regclass 
2012-10-29T16:43:41+00:00 app[web.1]: ActionView::Template::Error (PG::Error: ERROR: relation "users" does not exist 
2012-10-29T16:43:41+00:00 app[web.1]:          ^
2012-10-29T16:43:41+00:00 app[web.1]:     ON a.attrelid = d.adrelid AND a.attnum = d.adnum 
2012-10-29T16:43:41+00:00 app[web.1]:    FROM pg_attribute a LEFT JOIN pg_attrdef d 
2012-10-29T16:43:41+00:00 app[web.1]: :    SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull 
2012-10-29T16:43:41+00:00 app[web.1]:    WHERE a.attrelid = '"users"'::regclass 
2012-10-29T16:43:41+00:00 app[web.1]:    AND a.attnum > 0 AND NOT a.attisdropped 
2012-10-29T16:43:41+00:00 app[web.1]:    ORDER BY a.attnum 
2012-10-29T16:43:41+00:00 app[web.1]:): 
2012-10-29T16:43:41+00:00 app[web.1]:  1: 
2012-10-29T16:43:41+00:00 app[web.1]:  2:  <nav class="clearfix"> 
2012-10-29T16:43:41+00:00 app[web.1]:  3:   <% if !signed_in? %> 
2012-10-29T16:43:41+00:00 app[web.1]:  4:    <%= link_to "home", root_url %> 
2012-10-29T16:43:41+00:00 app[web.1]:  5:   <% else %> 
2012-10-29T16:43:41+00:00 app[web.1]:  6:    <%= link_to "my profile", current_user %> 
2012-10-29T16:43:41+00:00 app[web.1]: app/helpers/sessions_helper.rb:26:in `current_user' 
2012-10-29T16:43:41+00:00 app[web.1]: app/helpers/sessions_helper.rb:13:in `signed_in?' 
2012-10-29T16:43:41+00:00 app[web.1]: app/views/layouts/_header.html.erb:3:in `_app_views_layouts__header_html_erb__4262906123720065777_48014220' 
2012-10-29T16:43:41+00:00 app[web.1]: 
2012-10-29T16:43:41+00:00 app[web.1]: app/views/layouts/application.html.erb:13:in `_app_views_layouts_application_html_erb__2281927286696150034_48418280' 
2012-10-29T16:43:41+00:00 app[web.1]: 
2012-10-29T16:43:41+00:00 heroku[router]: GET pacific-ravine-3563.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=11ms status=200 bytes=1150 
2012-10-29T16:46:26+00:00 heroku[slugc]: Slug compilation started 
2012-10-29T16:46:53+00:00 heroku[web.1]: State changed from up to starting 
2012-10-29T16:46:53+00:00 heroku[slugc]: Slug compilation finished 
2012-10-29T16:46:56+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 30276` 
2012-10-29T16:46:57+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2012-10-29T16:46:58+00:00 app[web.1]: [2012-10-29 16:46:58] ERROR SignalException: SIGTERM 
2012-10-29T16:46:58+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select' 
2012-10-29T16:47:04+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2012-10-29T16:47:04+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2012-10-29T16:47:08+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM 
2012-10-29T16:47:08+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL 
2012-10-29T16:47:08+00:00 app[web.1]: => Booting WEBrick 
2012-10-29T16:47:08+00:00 app[web.1]: => Rails 3.2.8 application starting in production on http://0.0.0.0:30276 
2012-10-29T16:47:08+00:00 app[web.1]: => Call with -d to detach 
2012-10-29T16:47:08+00:00 app[web.1]: => Ctrl-C to shutdown server 
2012-10-29T16:47:08+00:00 app[web.1]: Connecting to database specified by DATABASE_URL 
2012-10-29T16:47:09+00:00 app[web.1]: [2012-10-29 16:47:09] INFO WEBrick 1.3.1 
2012-10-29T16:47:09+00:00 app[web.1]: [2012-10-29 16:47:09] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] 
2012-10-29T16:47:09+00:00 app[web.1]: [2012-10-29 16:47:09] INFO WEBrick::HTTPServer#start: pid=2 port=30276 
2012-10-29T16:47:10+00:00 heroku[web.1]: Process exited with status 137 
2012-10-29T16:47:10+00:00 heroku[web.1]: State changed from starting to up 
2012-10-29T16:47:46+00:00 app[web.1]: Started GET "/" for 66.108.172.226 at 2012-10-29 16:47:46 +0000 
2012-10-29T16:47:46+00:00 app[web.1]: 
2012-10-29T16:47:46+00:00 app[web.1]: 
2012-10-29T16:47:46+00:00 app[web.1]: Processing by HomeController#index as HTML 
2012-10-29T16:47:46+00:00 app[web.1]: Rendered home/index.html.erb within layouts/application (12.3ms) 
2012-10-29T16:47:46+00:00 app[web.1]: ActionView::Template::Error (PG::Error: ERROR: relation "users" does not exist 
2012-10-29T16:47:46+00:00 app[web.1]:          ^
2012-10-29T16:47:46+00:00 app[web.1]:    WHERE a.attrelid = '"users"'::regclass 
2012-10-29T16:47:46+00:00 app[web.1]:    FROM pg_attribute a LEFT JOIN pg_attrdef d 
2012-10-29T16:47:46+00:00 app[web.1]:    AND a.attnum > 0 AND NOT a.attisdropped 
2012-10-29T16:47:46+00:00 app[web.1]:     ON a.attrelid = d.adrelid AND a.attnum = d.adnum 
2012-10-29T16:47:46+00:00 app[web.1]: Rendered layouts/_header.html.erb (59.5ms) 
2012-10-29T16:47:46+00:00 app[web.1]: :    SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull 
2012-10-29T16:47:46+00:00 app[web.1]: 
2012-10-29T16:47:46+00:00 app[web.1]: Completed 500 Internal Server Error in 144ms 
2012-10-29T16:47:46+00:00 app[web.1]: LINE 4:    WHERE a.attrelid = '"users"'::regclass 
2012-10-29T16:47:46+00:00 app[web.1]:    ORDER BY a.attnum 
2012-10-29T16:47:46+00:00 app[web.1]:  1: 
2012-10-29T16:47:46+00:00 app[web.1]:  2:  <nav class="clearfix"> 
2012-10-29T16:47:46+00:00 app[web.1]:  3:   <% if !signed_in? %> 
2012-10-29T16:47:46+00:00 app[web.1]:  4:    <%= link_to "home", root_url %> 
2012-10-29T16:47:46+00:00 app[web.1]:): 
2012-10-29T16:47:46+00:00 app[web.1]:  6:    <%= link_to "my profile", current_user %> 
2012-10-29T16:47:46+00:00 app[web.1]:  5:   <% else %> 
2012-10-29T16:47:46+00:00 app[web.1]: app/helpers/sessions_helper.rb:26:in `current_user' 
2012-10-29T16:47:46+00:00 app[web.1]: 
2012-10-29T16:47:46+00:00 app[web.1]: app/helpers/sessions_helper.rb:13:in `signed_in?' 
2012-10-29T16:47:46+00:00 app[web.1]: app/views/layouts/_header.html.erb:3:in `_app_views_layouts__header_html_erb__1629561108313014440_42800200' 
2012-10-29T16:47:46+00:00 app[web.1]: app/views/layouts/application.html.erb:13:in `_app_views_layouts_application_html_erb__2023541485350786357_43765980' 
2012-10-29T16:47:46+00:00 app[web.1]: 
2012-10-29T16:47:46+00:00 heroku[router]: GET pacific-ravine-3563.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=1ms service=12ms status=200 bytes=1150 
2012-10-29T17:04:22+00:00 heroku[slugc]: Slug compilation started 
2012-10-29T17:04:41+00:00 heroku[slugc]: Slug compilation finished 
2012-10-29T17:04:41+00:00 heroku[web.1]: State changed from up to starting 
2012-10-29T17:04:43+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 38347` 
2012-10-29T17:04:44+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2012-10-29T17:04:44+00:00 app[web.1]: [2012-10-29 17:04:44] ERROR SignalException: SIGTERM 
2012-10-29T17:04:44+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select' 
2012-10-29T17:04:50+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2012-10-29T17:04:50+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2012-10-29T17:04:50+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2012-10-29T17:04:51+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select' 
2012-10-29T17:04:51+00:00 app[web.1]: [2012-10-29 17:04:51] ERROR SignalException: SIGTERM 
2012-10-29T17:04:55+00:00 app[web.1]: => Booting WEBrick 
2012-10-29T17:04:55+00:00 app[web.1]: => Rails 3.2.8 application starting in production on http://0.0.0.0:38347 
2012-10-29T17:04:55+00:00 app[web.1]: => Call with -d to detach 
2012-10-29T17:04:55+00:00 app[web.1]: => Ctrl-C to shutdown server 
2012-10-29T17:04:55+00:00 app[web.1]: Connecting to database specified by DATABASE_URL 
2012-10-29T17:04:55+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM 
2012-10-29T17:04:55+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL 
2012-10-29T17:04:55+00:00 app[web.1]: [2012-10-29 17:04:55] INFO WEBrick 1.3.1 
2012-10-29T17:04:55+00:00 app[web.1]: [2012-10-29 17:04:55] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] 
2012-10-29T17:04:55+00:00 app[web.1]: [2012-10-29 17:04:55] INFO WEBrick::HTTPServer#start: pid=2 port=38347 
2012-10-29T17:04:56+00:00 heroku[web.1]: State changed from starting to up 
2012-10-29T17:04:57+00:00 heroku[web.1]: Process exited with status 137 

模式

ActiveRecord::Schema.define(:version => 20121024185036) do 

create_table "albums", :force => true do |t| 
    t.string "name" 
    t.datetime "created_at", :null => false 
    t.datetime "updated_at", :null => false 
    t.string "description" 
    t.string "status" 
end 

create_table "friendships", :force => true do |t| 
    t.integer "user_id" 
    t.integer "friend_id" 
    t.datetime "created_at", :null => false 
    t.datetime "updated_at", :null => false 
    t.string "status" 
end 

create_table "ownerships", :id => false, :force => true do |t| 
    t.integer "album_id" 
    t.integer "user_id" 
    t.string "status" 
end 

create_table "photos", :force => true do |t| 
    t.string "avatar_file_name" 
    t.string "avatar_content_type" 
    t.integer "avatar_file_size" 
    t.datetime "avatar_updated_at" 
    t.datetime "created_at",   :null => false 
    t.datetime "updated_at",   :null => false 
    t.integer "album_id" 
end 

create_table "users", :force => true do |t| 
    t.string "name" 
    t.string "email" 
    t.datetime "created_at",    :null => false 
    t.datetime "updated_at",    :null => false 
    t.string "password_digest" 
    t.string "remember_token" 
    t.string "profilepic_file_name" 
    t.string "profilepic_content_type" 
    t.integer "profilepic_file_size" 
    t.datetime "profilepic_updated_at" 
    t.string "password_reset_token" 
end 

add_index "users", ["remember_token"], :name => "index_users_on_remember_token" 

的Heroku和本地數據庫:版本

Edmunds-MacBook-Pro:pholder edmundmai$ heroku run rake db:version 
Running `rake db:version` attached to terminal... up, run.1 
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7) 
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7) 
Connecting to database specified by DATABASE_URL 
Current version: 20120929230317 
Edmunds-MacBook-Pro:pholder edmundmai$ rake db:version 
Current version: 20121024185036 

回答

2

根據回溯,錯誤是線3你的模特吃 - 如果你看看postgres錯誤,你得到的消息是ERROR: relation "users" does not exist。你是否運行數據庫遷移?

+0

看起來像我一樣(我做了一個rake db:在閱讀你的評論後遷移,沒有任何改變...我會粘貼我的架構 – Edmund

+1

'heroku運行rake db:migrate'怎麼辦? rake db:version'告訴你,在本地比較'rake db:version' – girasquid

+0

我已經粘貼了我的heroku db版本和上面的本地db版本。運行'heroku run rake db:migrate'後我應該做任何git push heroku master或git add或git commit? – Edmund

相關問題