2012-07-19 112 views
0

我今天上传了一个应用程序到Heroku上,看到这个错误:应用程序错误heroku上的应用程序错误

应用程序发生错误,您的页面无法送达。请稍后重试。

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

这个应用程序在当地工作。这是我的日志。任何人有任何想法?

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 
+0

有在您的意见控制器语法错误。请提供您的'comments_controller'代码 – uday 2012-07-19 17:54:20

+0

我们可以使用您的comments_controller代码吗? – Dougui 2012-07-19 17:55:55

+0

当然。这是我的代码。 – 2012-07-19 17:58:13

回答

0

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

尝试再次更新您的代码github上,然后到Heroku上:

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

非常感谢你!!!!!!!!!!!!!!它工作!!!!!!!!!! – 2012-07-19 18:12:38