部署到Heroku时出错[包括日志]

时间:2013-05-25 03:30:04

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

我在部署到Heroku时遇到问题,我刚刚修复了一个postgresql错误,但现在有一个ActionView错误。不知道如何解决这个问题。请建议。

博客的git:https://github.com/Apane/Blogit_blog

Heroku Logs

2013-05-25T02:32:07.946326+00:00 app[web.1]:     1: <div class="right1">
2013-05-25T02:32:07.946326+00:00 app[web.1]:     2: <%= login_required class: "actions", id: "new_blog_post_link" do %>
2013-05-25T02:32:07.946326+00:00 app[web.1]:     3:   <%= link_to t(:new_blog_post, scope: 'blogit.posts'), new_post_path %>
2013-05-25T02:32:07.941979+00:00 app[web.1]:   Rendered blogit/posts/index.html.erb within layouts/application (91.1ms)
2013-05-25T02:32:07.946326+00:00 app[web.1]: 
2013-05-25T02:32:07.946326+00:00 app[web.1]: ActionView::Template::Error (unknown attribute: name):
2013-05-25T02:32:07.946326+00:00 app[web.1]:   app/controllers/application_controller.rb:5:in `current_user'
2013-05-25T02:32:07.946326+00:00 app[web.1]: 
2013-05-25T02:32:07.946665+00:00 app[web.1]: 
2013-05-25T02:32:07.946326+00:00 app[web.1]:   app/views/blogit/posts/index.html.erb:2:in `_app_views_blogit_posts_index_html_erb__3752095678148312245_34603300'
2013-05-25T02:32:07.946326+00:00 app[web.1]:     5: </div>
2013-05-25T02:32:07.946326+00:00 app[web.1]:     4: <% end %>
2013-05-25T02:32:07.997684+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM
2013-05-25T02:32:07.997684+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL
2013-05-25T02:32:10.467911+00:00 heroku[web.1]: Process exited with status 137
2013-05-25T02:37:19.248690+00:00 heroku[slugc]: Slug compilation started
2013-05-25T02:38:02.467323+00:00 heroku[api]: Deploy de08b17 by "email"
2013-05-25T02:38:02.493201+00:00 heroku[api]: Release v9 created by "email"
2013-05-25T02:38:02.544564+00:00 heroku[api]: Deploy de08b17 by "email"
2013-05-25T02:38:03.445329+00:00 heroku[slugc]: Slug compilation finished
2013-05-25T02:38:04.208989+00:00 heroku[web.1]: State changed from up to starting
2013-05-25T02:38:06.350047+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 41915`
2013-05-25T02:38:07.613671+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-05-25T02:38:08.321413+00:00 app[web.1]: [2013-05-25 02:38:08] ERROR SignalException: SIGTERM
2013-05-25T02:38:08.321413+00:00 app[web.1]:    /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select'
2013-05-25T02:38:15.184606+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)
2013-05-25T02:38:15.184606+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)
2013-05-25T02:38:15.187273+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)
2013-05-25T02:38:16.758556+00:00 app[web.1]: [Blogit]: Blogit::Configuration#rss_feed_language has been deprecated. You can remove this from your blogit.rb configuration file
2013-05-25T02:38:17.431528+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM
2013-05-25T02:38:17.431823+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL
2013-05-25T02:38:18.932239+00:00 app[web.1]: [2013-05-25 02:38:18] INFO  ruby 1.9.2 (2011-07-09) [x86_64-linux]
2013-05-25T02:38:18.932504+00:00 app[web.1]: [2013-05-25 02:38:18] INFO  WEBrick::HTTPServer#start: pid=2 port=41915
2013-05-25T02:38:18.932239+00:00 app[web.1]: [2013-05-25 02:38:18] INFO  WEBrick 1.3.1
2013-05-25T02:38:19.138465+00:00 heroku[web.1]: State changed from starting to up
2013-05-25T02:38:19.286419+00:00 heroku[web.1]: Process exited with status 137
2013-05-25T02:38:24.702435+00:00 app[web.1]: Started GET "/" for 99.233.170.104 at 2013-05-25 02:38:24 +0000
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Call with -d to detach
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Booting WEBrick
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:41915
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-05-25T02:38:24.865680+00:00 app[web.1]: Processing by Blogit::PostsController#index as HTML
2013-05-25T02:38:25.061058+00:00 app[web.1]:   Rendered blogit/posts/index.html.erb within layouts/application (130.6ms)
2013-05-25T02:38:25.061376+00:00 app[web.1]: Completed 500 Internal Server Error in 196ms
2013-05-25T02:38:25.063272+00:00 app[web.1]: 
2013-05-25T02:38:25.063272+00:00 app[web.1]: ActionView::Template::Error (unknown attribute: name):
2013-05-25T02:38:25.063272+00:00 app[web.1]:     1: <div class="right1">
2013-05-25T02:38:25.063092+00:00 heroku[router]: at=info method=GET path=/ host=infinite-springs-1056.herokuapp.com fwd="99.233.170.104" dyno=web.1 connect=3ms service=407ms status=500 bytes=643
2013-05-25T02:38:25.063272+00:00 app[web.1]:     2: <%= login_required class: "actions", id: "new_blog_post_link" do %>
2013-05-25T02:38:25.063272+00:00 app[web.1]:     4: <% end %>
2013-05-25T02:38:25.063585+00:00 app[web.1]: 
2013-05-25T02:38:25.063272+00:00 app[web.1]:     3:   <%= link_to t(:new_blog_post, scope: 'blogit.posts'), new_post_path %>
2013-05-25T02:38:25.063272+00:00 app[web.1]:     5: </div>
2013-05-25T02:38:25.063272+00:00 app[web.1]:   app/views/blogit/posts/index.html.erb:2:in `_app_views_blogit_posts_index_html_erb___1859728747634219045_31435420'
2013-05-25T02:38:25.063272+00:00 app[web.1]: 
2013-05-25T02:38:25.063272+00:00 app[web.1]:   app/controllers/application_controller.rb:5:in `current_user'
2013-05-25T02:39:31.009984+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by "email"
2013-05-25T02:39:35.228241+00:00 heroku[run.1589]: Awaiting client
2013-05-25T02:39:35.254224+00:00 heroku[run.1589]: Starting process with command `bundle exec rake db:migrate`
2013-05-25T02:39:36.715005+00:00 heroku[run.1589]: State changed from starting to up
2013-05-25T02:39:43.583619+00:00 heroku[run.1589]: Process exited with status 0
2013-05-25T02:39:43.598693+00:00 heroku[run.1589]: State changed from up to complete
2013-05-25T02:47:44.635791+00:00 heroku[api]: Deploy 3b2c0e0 by "email"
2013-05-25T02:47:44.659753+00:00 heroku[api]: Release v10 created by "email"
2013-05-25T02:47:44.704699+00:00 heroku[api]: Deploy 3b2c0e0 by "email"
2013-05-25T02:47:45.205793+00:00 heroku[web.1]: State changed from up to starting
2013-05-25T02:47:48.591029+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 27123`
2013-05-25T02:47:49.862664+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-05-25T02:47:50.836497+00:00 app[web.1]: [2013-05-25 02:47:50] ERROR SignalException: SIGTERM
2013-05-25T02:47:50.836497+00:00 app[web.1]:    /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select'
2013-05-25T02:47:54.610704+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)
2013-05-25T02:47:54.611109+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)
2013-05-25T02:47:54.611344+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)
2013-05-25T02:47:56.472610+00:00 app[web.1]: [Blogit]: Blogit::Configuration#rss_feed_language has been deprecated. You can remove this from your blogit.rb configuration file
2013-05-25T02:47:57.907795+00:00 app[web.1]: [2013-05-25 02:47:57] INFO  WEBrick 1.3.1
2013-05-25T02:47:57.907795+00:00 app[web.1]: [2013-05-25 02:47:57] INFO  ruby 1.9.2 (2011-07-09) [x86_64-linux]
2013-05-25T02:47:57.908723+00:00 app[web.1]: [2013-05-25 02:47:57] INFO  WEBrick::HTTPServer#start: pid=2 port=27123
2013-05-25T02:47:58.197066+00:00 heroku[web.1]: State changed from starting to up
2013-05-25T02:47:58.851641+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM
2013-05-25T02:47:58.851887+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Booting WEBrick
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:27123
2013-05-25T02:48:00.088867+00:00 app[web.1]: Started GET "/" for 99.233.170.104 at 2013-05-25 02:48:00 +0000
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Call with -d to detach
2013-05-25T02:48:00.290164+00:00 app[web.1]: Processing by Blogit::PostsController#index as HTML
2013-05-25T02:48:00.460839+00:00 app[web.1]:   Rendered blogit/posts/index.html.erb within layouts/application (98.8ms)
2013-05-25T02:48:00.462767+00:00 app[web.1]: 
2013-05-25T02:48:00.462767+00:00 app[web.1]:     1: <div class="right1">
2013-05-25T02:48:00.461055+00:00 app[web.1]: Completed 500 Internal Server Error in 171ms
2013-05-25T02:48:00.462767+00:00 app[web.1]: ActionView::Template::Error (unknown attribute: name):
2013-05-25T02:48:00.462767+00:00 app[web.1]:     4: <% end %>
2013-05-25T02:48:00.462767+00:00 app[web.1]:     3:   <%= link_to t(:new_blog_post, scope: 'blogit.posts'), new_post_path %>
2013-05-25T02:48:00.462767+00:00 app[web.1]:     2: <%= login_required class: "actions", id: "new_blog_post_link" do %>
2013-05-25T02:48:00.462767+00:00 app[web.1]:     5: </div>
2013-05-25T02:48:00.462767+00:00 app[web.1]:   app/controllers/application_controller.rb:5:in `current_user'
2013-05-25T02:48:00.462767+00:00 app[web.1]:   app/views/blogit/posts/index.html.erb:2:in `_app_views_blogit_posts_index_html_erb___1549385033592403810_36478100'
2013-05-25T02:48:00.462767+00:00 app[web.1]: 
2013-05-25T02:48:00.463077+00:00 app[web.1]: 
2013-05-25T02:48:00.471980+00:00 heroku[router]: at=info method=GET path=/ host=infinite-springs-1056.herokuapp.com fwd="99.233.170.104" dyno=web.1 connect=3ms service=421ms status=500 bytes=643
2013-05-25T02:48:01.026129+00:00 heroku[web.1]: Process exited with status 137

1 个答案:

答案 0 :(得分:2)

这是你的问题。在schema.rb中你有

create_table "users", :force => true do |t|
  t.datetime "created_at", :null => false
  t.datetime "updated_at", :null => false
end 

并在User.rb中有

class User < ActiveRecord::Base

  attr_accessible :name

  blogs

  def username
    name = "Anthony Panepinto"
  end

end

您需要删除username方法并运行migration以添加username作为User的属性

rails generate migration add_username_to_users username:string

然后运行

rake db:migrate

如果你做得对,你的schema.rb将会是这样的

create_table "users", :force => true do |t|
  t.datetime "created_at", :null => false
  t.datetime "updated_at", :null => false
  t.string "username"
end 

User.rb应该看起来像

class User < ActiveRecord::Base

  attr_accessible :name

  blogs

end

您希望在开发环境中本地执行所有这些操作,以确保在将其推送到Heroku之前一切正常。它首先在开发中更容易调试,而不是查看Heroku错误日志。