heroku上的应用程序错误

时间:2012-07-19 17:51:56

标签: ruby-on-rails ruby

我今天在Heroku上传了一个应用程序并看到了这个错误:pplication Error

应用程序中发生错误,无法提供您的页面。请稍后再试。

如果您是应用程序所有者,请查看日志以获取详细信息。

此应用适用于本地。这是我的日志。有人有什么想法吗?

2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `block in require'

2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
railties-3.2.6/lib/rails/engine.rb:436:in `each'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
railties-3.2.6/lib/rails/initializable.rb:54:in `each'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
railties-3.2.6/lib/rails/application.rb:136:in `initialize!'
2012-07-19T15:36:53+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actives
upport-3.2.6/lib/active_support/dependencies.rb:251:in `require': /app/app/contr
ollers/comments_controller.rb:9: syntax error, unexpected $end, expecting keywor
d_end (SyntaxError)
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
activesupport-3.2.6/lib/active_support/dependencies.rb:359:in `require_or_load'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
railties-3.2.6/lib/rails/railtie/configurable.rb:30:in `method_missing'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
activesupport-3.2.6/lib/active_support/dependencies.rb:313:in `depend_on'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
2012-07-19T15:36:53+00:00 app[web.1]:   from config.ru:1:in `new'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
activesupport-3.2.6/lib/active_support/dependencies.rb:225:in `require_dependenc
y'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
railties-3.2.6/lib/rails/engine.rb:438:in `block in eager_load!'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
railties-3.2.6/lib/rails/initializable.rb:54:in `run_initializers'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
railties-3.2.6/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
2012-07-19T15:36:53+00:00 app[web.1]:   from config.ru:3:in `block in <main>'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
thin-1.4.1/lib/rack/adapter/loader.rb:33:in `eval'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
railties-3.2.6/lib/rails/engine.rb:438:in `each'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
railties-3.2.6/lib/rails/application/finisher.rb:53:in `block in <module:Finishe
r>'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
railties-3.2.6/lib/rails/initializable.rb:30:in `run'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
railties-3.2.6/lib/rails/engine.rb:436:in `eager_load!'
2012-07-19T15:36:53+00:00 app[web.1]:   from config.ru:3:in `require'
2012-07-19T15:36:53+00:00 app[web.1]:   from config.ru:1:in `<main>'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
thin-1.4.1/lib/rack/adapter/loader.rb:33:in `load'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/t
hin:19:in `load'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
thin-1.4.1/lib/thin/controllers/controller.rb:181:in `load_rackup_config'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
thin-1.4.1/lib/thin/controllers/controller.rb:71:in `start'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
thin-1.4.1/bin/thin:6:in `<top (required)>'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
railties-3.2.6/lib/rails/initializable.rb:30:in `instance_exec'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
railties-3.2.6/lib/rails/initializable.rb:55:in `block in run_initializers'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/config/environment.rb:5:in `<t
op (required)>'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
thin-1.4.1/lib/thin/runner.rb:185:in `run_command'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/
thin-1.4.1/lib/thin/runner.rb:151:in `run!'
2012-07-19T15:36:53+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/t
hin:19:in `<main>'
2012-07-19T15:36:54+00:00 heroku[web.1]: Process exited with status 1
2012-07-19T15:36:54+00:00 heroku[web.1]: State changed from starting to crashed
2012-07-19T15:36:57+00:00 heroku[router]: Error H10 (App crashed) -> GET secret-
reaches-4317.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
2012-07-19T15:36:57+00:00 heroku[router]: Error H10 (App crashed) -> GET secret-
reaches-4317.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes

我的控制器代码

class CommentsController < ApplicationController
 http_basic_authenticate_with :name => "test", :password => "test", :only => :destroy
  def create
    @post = Post.find(params[:post_id])
    @comment = @post.comments.create(params[:comment])
    redirect_to post_path(@post)
  end

  def destroy
    @post = Post.find(params[:post_id])
    @comment = @post.comments.find(params[:id])
    @comment.destroy
    redirect_to post_path(@post)
  end

end

1 个答案:

答案 0 :(得分:0)

根据错误,当您使用$end时,您正在使用end。但是,您向我们展示的代码是正确的。所以,我相信你在heroku上的代码与你在计算机中的代码不同。

尝试将代码更新为github,然后再次更新到heroku:

git add .
git commit -m "update"
git push
git push heroko