繁体   English   中英

Rails + Heroku:ActionView :: Template :: Error

[英]Rails + Heroku : ActionView::Template::Error

我在将rails应用程序部署到heroku时遇到了麻烦。 我刚修正错误Rails + Heroku:我们很抱歉,但出了点问题,但我猜还有更多错误 任何人都可以帮助指导我如何调试它? 我被卡住了,因为heroku没有告诉我错误发生了什么行。 抱歉打扰了。

如果你想看一下,这是我的所有代码。 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和本地db:版本

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

根据回溯,错误位于模板的第3行 - 如果你查看postgres错误,你得到的消息是ERROR: relation "users" does not exist 您是否运行过数据库迁移?

暂无
暂无

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

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