Rails heroku 部署故障排除

发布于 2024-11-01 23:51:30 字数 12809 浏览 1 评论 0原文

所以我创建了一个heroku应用程序,将其推上来,db:migrate它已经。该应用程序在我的本地计算机上运行良好,但在 Heroku 上崩溃了。我是新手,不知道从哪里开始解决这个问题。提前致谢!从创建应用程序到迁移的所有日志都在这里:

2011-04-17T22:51:03-07:00 heroku[slugc]: Slug compilation finished
2011-04-18T05:51:07+00:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require': /app/app/controllers/users_controller.rb:28: syntax error, unexpected '.', expecting kEND (SyntaxError)
2011-04-18T05:51:07+00:00 app[web.1]: ...                             .paginate(:page => params[:page...
2011-04-18T05:51:07+00:00 app[web.1]:                               ^
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:227:in `load_dependency'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:346:in `require_or_load'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:300:in `depend_on'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:216:in `require_dependency'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:138:in `eager_load!'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:137:in `each'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:137:in `eager_load!'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:135:in `each'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:135:in `eager_load!'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:108:in `eager_load!'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application/finisher.rb:41
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `run_initializers'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `send'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/config/environment.rb:5
2011-04-18T05:51:07+00:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
2011-04-18T05:51:07+00:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
2011-04-18T05:51:07+00:00 app[web.1]:   from config.ru:3
2011-04-18T05:51:07+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:63:in `new'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:63:in `map'
2011-04-18T05:51:07+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:18
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
2011-04-18T05:51:07+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11:in `new'
2011-04-18T05:51:07+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1
2011-04-17T22:51:07-07:00 heroku[web.1]: State changed from starting to crashed
2011-04-17T22:51:07-07:00 heroku[web.1]: State changed from crashed to created
2011-04-17T22:51:07-07:00 heroku[web.1]: State changed from created to starting
2011-04-17T22:51:10-07:00 heroku[web.1]: State changed from created to starting
2011-04-18T05:51:11+00:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require': /app/app/controllers/users_controller.rb:28: syntax error, unexpected '.', expecting kEND (SyntaxError)
2011-04-18T05:51:11+00:00 app[web.1]: ...                             .paginate(:page => params[:page...
2011-04-18T05:51:11+00:00 app[web.1]:                               ^
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:227:in `load_dependency'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:346:in `require_or_load'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:300:in `depend_on'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:216:in `require_dependency'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:138:in `eager_load!'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:137:in `each'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:137:in `eager_load!'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:135:in `each'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:135:in `eager_load!'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:108:in `eager_load!'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application/finisher.rb:41
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `run_initializers'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `send'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/config/environment.rb:5
2011-04-18T05:51:11+00:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
2011-04-18T05:51:11+00:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
2011-04-18T05:51:11+00:00 app[web.1]:   from config.ru:3
2011-04-18T05:51:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:63:in `new'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:63:in `map'
2011-04-18T05:51:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:18
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
2011-04-18T05:51:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11:in `new'
2011-04-18T05:51:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
2011-04-18T05:51:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1:in `new'
2011-04-18T05:51:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1
2011-04-17T22:51:15-07:00 heroku[web.1]: State changed from starting to crashed
2011-04-18T05:51:21+00:00 heroku[router]: Error H10 (App crashed) -> GET indelearn.heroku.com/ dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-04-17T22:51:22-07:00 heroku[nginx]: GET / HTTP/1.1 | 75.72.164.255 | 795 | http | 503
2011-04-18T05:51:22+00:00 heroku[router]: Error H10 (App crashed) -> GET indelearn.heroku.com/favicon.ico dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-04-17T22:51:22-07:00 heroku[nginx]: GET /favicon.ico HTTP/1.1 | 75.72.164.255 | 795 | http | 503
2011-04-17T22:51:39-07:00 heroku[rake.1]: State changed from created to starting
2011-04-17T22:51:43-07:00 heroku[rake.1]: State changed from starting to up
2011-04-17T22:51:49-07:00 heroku[rake.1]: State changed from up to complete
2011-04-18T05:51:59+00:00 heroku[router]: Error H10 (App crashed) -> GET indelearn.heroku.com/ dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-04-17T22:51:59-07:00 heroku[nginx]: GET / HTTP/1.1 | 75.72.164.255 | 795 | http | 503
2011-04-18T05:51:59+00:00 heroku[router]: Error H10 (App crashed) -> GET indelearn.heroku.com/favicon.ico dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-04-17T22:51:59-07:00 heroku[nginx]: GET /favicon.ico HTTP/1.1 | 75.72.164.255 | 795 | http | 503
2011-04-18T05:52:00+00:00 heroku[router]: Error H10 (App crashed) -> GET indelearn.heroku.com/ dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-04-17T22:52:00-07:00 heroku[nginx]: GET / HTTP/1.1 | 75.72.164.255 | 795 | http | 503
2011-04-18T05:52:01+00:00 heroku[router]: Error H10 (App crashed) -> GET indelearn.heroku.com/favicon.ico dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-04-17T22:52:01-07:00 heroku[nginx]: GET /favicon.ico HTTP/1.1 | 75.72.164.255 | 795 | http | 503

users_contoller #28 是一个分页,后跟一个非常长的 sql 查询:

@discussions = Discussion.find_by_sql("SELECT d.*, MAX(c.created_at) AS lastCommentTime 
                 FROM discussions d JOIN comments c ON d.id = c.commentable_id 
                 WHERE c.commentable_type = 'Discussion' AND c.user_id = #{@user.id} 
                 GROUP BY d.id ORDER BY lastCommentTime DESC")
                 .paginate(:page => params[:page], :per_page => 10)

所以我删除了点之前的换行符,它已修复。感谢你们的超能力!对于新手来说,很难在该日志文件中发现关键错误行。 :)

So I created a heroku app, pushed it up, db:migrate it already. The app works fine on my local machine, but it just crashes on heroku. I'm a newbie and don't know where to start trouble-shooting this. Thanks in advance! All the logs from creating the app to migration are here:

2011-04-17T22:51:03-07:00 heroku[slugc]: Slug compilation finished
2011-04-18T05:51:07+00:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require': /app/app/controllers/users_controller.rb:28: syntax error, unexpected '.', expecting kEND (SyntaxError)
2011-04-18T05:51:07+00:00 app[web.1]: ...                             .paginate(:page => params[:page...
2011-04-18T05:51:07+00:00 app[web.1]:                               ^
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:227:in `load_dependency'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:346:in `require_or_load'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:300:in `depend_on'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:216:in `require_dependency'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:138:in `eager_load!'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:137:in `each'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:137:in `eager_load!'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:135:in `each'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:135:in `eager_load!'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:108:in `eager_load!'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application/finisher.rb:41
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `run_initializers'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `send'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/config/environment.rb:5
2011-04-18T05:51:07+00:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
2011-04-18T05:51:07+00:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
2011-04-18T05:51:07+00:00 app[web.1]:   from config.ru:3
2011-04-18T05:51:07+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:63:in `new'
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:63:in `map'
2011-04-18T05:51:07+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:18
2011-04-18T05:51:07+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
2011-04-18T05:51:07+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11:in `new'
2011-04-18T05:51:07+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1
2011-04-17T22:51:07-07:00 heroku[web.1]: State changed from starting to crashed
2011-04-17T22:51:07-07:00 heroku[web.1]: State changed from crashed to created
2011-04-17T22:51:07-07:00 heroku[web.1]: State changed from created to starting
2011-04-17T22:51:10-07:00 heroku[web.1]: State changed from created to starting
2011-04-18T05:51:11+00:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require': /app/app/controllers/users_controller.rb:28: syntax error, unexpected '.', expecting kEND (SyntaxError)
2011-04-18T05:51:11+00:00 app[web.1]: ...                             .paginate(:page => params[:page...
2011-04-18T05:51:11+00:00 app[web.1]:                               ^
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:227:in `load_dependency'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:346:in `require_or_load'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:300:in `depend_on'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:216:in `require_dependency'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:138:in `eager_load!'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:137:in `each'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:137:in `eager_load!'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:135:in `each'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/engine.rb:135:in `eager_load!'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:108:in `eager_load!'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application/finisher.rb:41
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `run_initializers'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `send'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/config/environment.rb:5
2011-04-18T05:51:11+00:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
2011-04-18T05:51:11+00:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
2011-04-18T05:51:11+00:00 app[web.1]:   from config.ru:3
2011-04-18T05:51:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:63:in `new'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:63:in `map'
2011-04-18T05:51:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:18
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
2011-04-18T05:51:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11:in `new'
2011-04-18T05:51:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:11
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
2011-04-18T05:51:11+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
2011-04-18T05:51:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1:in `new'
2011-04-18T05:51:11+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1
2011-04-17T22:51:15-07:00 heroku[web.1]: State changed from starting to crashed
2011-04-18T05:51:21+00:00 heroku[router]: Error H10 (App crashed) -> GET indelearn.heroku.com/ dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-04-17T22:51:22-07:00 heroku[nginx]: GET / HTTP/1.1 | 75.72.164.255 | 795 | http | 503
2011-04-18T05:51:22+00:00 heroku[router]: Error H10 (App crashed) -> GET indelearn.heroku.com/favicon.ico dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-04-17T22:51:22-07:00 heroku[nginx]: GET /favicon.ico HTTP/1.1 | 75.72.164.255 | 795 | http | 503
2011-04-17T22:51:39-07:00 heroku[rake.1]: State changed from created to starting
2011-04-17T22:51:43-07:00 heroku[rake.1]: State changed from starting to up
2011-04-17T22:51:49-07:00 heroku[rake.1]: State changed from up to complete
2011-04-18T05:51:59+00:00 heroku[router]: Error H10 (App crashed) -> GET indelearn.heroku.com/ dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-04-17T22:51:59-07:00 heroku[nginx]: GET / HTTP/1.1 | 75.72.164.255 | 795 | http | 503
2011-04-18T05:51:59+00:00 heroku[router]: Error H10 (App crashed) -> GET indelearn.heroku.com/favicon.ico dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-04-17T22:51:59-07:00 heroku[nginx]: GET /favicon.ico HTTP/1.1 | 75.72.164.255 | 795 | http | 503
2011-04-18T05:52:00+00:00 heroku[router]: Error H10 (App crashed) -> GET indelearn.heroku.com/ dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-04-17T22:52:00-07:00 heroku[nginx]: GET / HTTP/1.1 | 75.72.164.255 | 795 | http | 503
2011-04-18T05:52:01+00:00 heroku[router]: Error H10 (App crashed) -> GET indelearn.heroku.com/favicon.ico dyno=none queue=0 wait=0ms service=0ms bytes=0
2011-04-17T22:52:01-07:00 heroku[nginx]: GET /favicon.ico HTTP/1.1 | 75.72.164.255 | 795 | http | 503

The users_contoller #28 is a paginate followed by a really long sql query:

@discussions = Discussion.find_by_sql("SELECT d.*, MAX(c.created_at) AS lastCommentTime 
                 FROM discussions d JOIN comments c ON d.id = c.commentable_id 
                 WHERE c.commentable_type = 'Discussion' AND c.user_id = #{@user.id} 
                 GROUP BY d.id ORDER BY lastCommentTime DESC")
                 .paginate(:page => params[:page], :per_page => 10)

So I've deleted the line-break before the dot and it is fixed. Thanks for you guys' superpowers! It's so hard for a newbie to spot the critical error line in that log file. :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陌生 2024-11-08 23:51:30

堆栈跟踪在第 28 行提到了 app/controllers/users_controller.rb。该文件及其周围的代码是什么?这很可能是您会发现问题的地方。

另外,我知道这听起来很愚蠢,但请仔细检查所有内容是否都已签入您的 Git 存储库。由于 Heroku 是基于 Git 的,因此很容易忘记签入某些内容,并且 git 将应用程序的旧版本推送到服务器。

The stack trace mentions app/controllers/users_controller.rb at line 28. What is the code at and around this file? That is likely where you'll find your issue.

Also, I know it sounds silly, but triple-check that everything is checked in to your Git repo. Since Heroku is Git-based, it's easy to forget to check something in, and git push an old version of your app to the server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文