2013-05-10 54 views
2

我刚将我的Rails应用程序推送到Heroku。然后我运行heroku db:然后迁移heroku db:push。但是,当我打开应用程序时,我收到错误信息“应用程序中发生了错误,并且您的页面无法投放,请稍后重试。如果您是应用程序所有者,请查看您的日志以了解详细信息。Heroku应用程序错误:了解日志

于是我就Heroku的日志,这是我得到:

$ heroku logs 
2013-05-10T17:13:21.460654+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `instance_exec' 
2013-05-10T17:13:21.461171+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands/server.rb:46:in `app' 
2013-05-10T17:13:21.461171+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app' 
2013-05-10T17:13:21.461171+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:254:in `start' 
2013-05-10T17:13:21.460325+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require': /app/app/controllers/users_controller.rb:54: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' (SyntaxError) 
2013-05-10T17:13:21.460325+00:00 app[web.1]:   redirect_to signin_url, notice: t "user.please" 
2013-05-10T17:13:21.460325+00:00 app[web.1]:  ^
2013-05-10T17:13:21.460325+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `block in require' 
2013-05-10T17:13:21.460325+00:00 app[web.1]: Exiting 
2013-05-10T17:13:21.460654+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `run' 
2013-05-10T17:13:21.460654+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/initializable.rb:55:in `block in run_initializers' 
2013-05-10T17:13:21.460654+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `each' 
2013-05-10T17:13:21.461171+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands/server.rb:70:in `start' 
2013-05-10T17:13:21.461171+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands.rb:55:in `block in <top (required)>' 
2013-05-10T17:13:21.461171+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands.rb:50:in `tap' 
2013-05-10T17:13:21.461171+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:200:in `app' 
2013-05-10T17:13:21.461171+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file' 
2013-05-10T17:13:21.460325+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:313:in `depend_on' 
2013-05-10T17:13:21.460325+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:225:in `require_dependency' 
2013-05-10T17:13:21.460654+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!' 
2013-05-10T17:13:21.460654+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/engine.rb:438:in `each' 
2013-05-10T17:13:21.460325+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:359:in `require_ 
or_load' 
2013-05-10T17:13:21.460896+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `run_initializers' 
2013-05-10T17:13:21.460896+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/application.rb:136:in `initialize!' 
2013-05-10T17:13:21.460896+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/railtie/configurable.rb:30:in `method_missing' 

2013-05-10T17:13:21.461171+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/commands.rb:50:in `<top (required)>' 
2013-05-10T17:13:21.461416+00:00 app[web.1]: from script/rails:6:in `require' 

2013-05-10T17:13:21.460896+00:00 app[web.1]: from /app/config.ru:in `new' 
2013-05-10T17:13:21.460896+00:00 app[web.1]: from /app/config.ru:in `<main>' 
2013-05-10T17:13:21.461171+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval' 
2013-05-10T17:13:21.460896+00:00 app[web.1]: from /app/config/environment.rb: 
5:in `<top (required)>' 
2013-05-10T17:13:21.460896+00:00 app[web.1]: from /app/config.ru:3:in `requir 
e' 
2013-05-10T17:13:21.460896+00:00 app[web.1]: from /app/config.ru:3:in `block 
in <main>' 
2013-05-10T17:13:21.460896+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval' 
2013-05-10T17:13:21.460896+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize' 
2013-05-10T17:13:21.460325+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require' 

2013-05-10T17:13:21.461416+00:00 app[web.1]: from script/rails:6:in `<main>' 
2013-05-10T17:13:23.235761+00:00 heroku[web.1]: State changed from starting to c 
rashed 
2013-05-10T17:13:23.221686+00:00 heroku[web.1]: Process exited with status 1 
2013-05-10T17:13:23.237632+00:00 heroku[web.1]: State changed from crashed to st 
arting 
2013-05-10T17:13:24.507187+00:00 heroku[web.1]: Starting process with command `b 
undle exec rails server -p 10305` 
2013-05-10T17:13:27.937367+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-h 
as-been-released. (called from <top (required)> at /app/config/environment.rb:5) 

2013-05-10T17:13:27.935835+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-h 
as-been-released. (called from <top (required)> at /app/config/environment.rb:5) 

2013-05-10T17:13:27.938348+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-h 
as-been-released. (called from <top (required)> at /app/config/environment.rb:5) 

2013-05-10T17:13:31.274313+00:00 app[web.1]: => Booting WEBrick 
2013-05-10T17:13:31.274313+00:00 app[web.1]: => Ctrl-C to shutdown server 
2013-05-10T17:13:31.274313+00:00 app[web.1]: => Call with -d to detach 
2013-05-10T17:13:31.274313+00:00 app[web.1]: => Rails 3.2.12 application startin 
g in production on http://0.0.0.0:10305 
2013-05-10T17:13:31.274313+00:00 app[web.1]: Connecting to database specified by 
DATABASE_URL 
2013-05-10T17:13:31.512180+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/application/finisher.rb:53:in `block in <modul 
e:Finisher>' 
2013-05-10T17:13:31.511810+00:00 app[web.1]:   redirect_to signin_url, not 
ice: t "user.please" 
2013-05-10T17:13:31.511810+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require' 

2013-05-10T17:13:31.511810+00:00 app[web.1]: 
     ^
2013-05-10T17:13:31.511810+00:00 app[web.1]: Exiting 
2013-05-10T17:13:31.511810+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:359:in `require_ 
or_load' 
2013-05-10T17:13:31.512180+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/engin 
e.rb:439:in `block (2 levels) in eager_load!' 
2013-05-10T17:13:31.511810+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/ 
activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require': /app/a 
pp/controllers/users_controller.rb:54: syntax error, unexpected tSTRING_BEG, exp 
ecting keyword_do or '{' or '(' (SyntaxError) 
2013-05-10T17:13:31.512434+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/railtie/configurable.rb:30:in `method_missing' 

2013-05-10T17:13:31.512434+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval' 
2013-05-10T17:13:31.512434+00:00 app[web.1]: from /app/config.ru:3:in `requir 
e' 
2013-05-10T17:13:31.512702+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/rack-1.4.5/lib/rack/server.rb:200:in `app' 
2013-05-10T17:13:31.512180+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/engine.rb:438:in `block in eager_load!' 
2013-05-10T17:13:31.511810+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dep 
endency' 
2013-05-10T17:13:31.511810+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `block in 
require' 
2013-05-10T17:13:31.511810+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:225:in `require_ 
dependency' 
2013-05-10T17:13:31.512180+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/engine.rb:436:in `eager_load!' 
2013-05-10T17:13:31.512180+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/initializable.rb:55:in `block in run_initializ 
ers' 
2013-05-10T17:13:31.512434+00:00 app[web.1]: from /app/config.ru:in `<main>' 
2013-05-10T17:13:31.512702+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/commands/server.rb:46:in `app' 
2013-05-10T17:13:31.512434+00:00 app[web.1]: from /app/config/environment.rb: 
5:in `<top (required)>' 
2013-05-10T17:13:31.511810+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:313:in `depend_o 
n' 
2013-05-10T17:13:31.512702+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/commands/server.rb:70:in `start' 
2013-05-10T17:13:31.512434+00:00 app[web.1]: from /app/config.ru:in `new' 
2013-05-10T17:13:31.512702+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file' 
2013-05-10T17:13:31.512702+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/commands.rb:55:in `block in <top (required)>' 
2013-05-10T17:13:31.512991+00:00 app[web.1]: from script/rails:6:in `<main>' 
2013-05-10T17:13:31.512180+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/engine.rb:438:in `each' 
2013-05-10T17:13:31.512180+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `run' 
2013-05-10T17:13:31.512180+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/initializable.rb:30:in `instance_exec' 
2013-05-10T17:13:31.512434+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize' 
2013-05-10T17:13:31.512434+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/application.rb:136:in `initialize!' 
2013-05-10T17:13:31.512991+00:00 app[web.1]: from script/rails:6:in `require' 

2013-05-10T17:13:31.512702+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval' 
2013-05-10T17:13:31.512702+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app' 
2013-05-10T17:13:31.512180+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/engine.rb:436:in `each' 
2013-05-10T17:13:31.512434+00:00 app[web.1]: from /app/config.ru:3:in `block 
in <main>' 
2013-05-10T17:13:31.512702+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/rack-1.4.5/lib/rack/server.rb:254:in `start' 
2013-05-10T17:13:31.512702+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/commands.rb:50:in `tap' 
2013-05-10T17:13:31.512180+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `each' 
2013-05-10T17:13:31.512434+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/initializable.rb:54:in `run_initializers' 
2013-05-10T17:13:31.512702+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9 
.1/gems/railties-3.2.12/lib/rails/commands.rb:50:in `<top (required)>' 
2013-05-10T17:13:42.307007+00:00 heroku[web.1]: Process exited with status 1 
2013-05-10T17:13:42.323377+00:00 heroku[web.1]: State changed from starting to c 
rashed 
2013-05-10T17:13:55.228036+00:00 heroku[api]: Starting process with command `bun 
dle exec rake db:migrate` by [email protected] 
2013-05-10T17:13:57.306953+00:00 heroku[run.6043]: Awaiting client 
2013-05-10T17:13:57.324094+00:00 heroku[run.6043]: Starting process with command 
`bundle exec rake db:migrate` 
2013-05-10T17:13:58.232657+00:00 heroku[run.6043]: State changed from starting t 
o up 
2013-05-10T17:14:06.400819+00:00 heroku[run.6043]: Process exited with status 0 
2013-05-10T17:14:06.419565+00:00 heroku[run.6043]: State changed from up to comp 
lete 
2013-05-10T17:17:30.518444+00:00 heroku[router]: at=error code=H10 desc="App cra 
shed" method=GET path=/ host=immense-refuge-9281.herokuapp.com fwd="94.116.4.100 
" dyno= connect= service= status=503 bytes= 
2013-05-10T17:17:30.975159+00:00 heroku[router]: at=error code=H10 desc="App cra 
shed" method=GET path=/favicon.ico host=immense-refuge-9281.herokuapp.com fwd="9 
4.116.4.100" dyno= connect= service= status=503 bytes= 

我几乎任何意义的这个文件在这里了。有什么我可能做错了吗?我使用的是Rails 3.2,我已经确定我使用了heroku - stack雪松,因为我在某处读到了Heroku只支持雪松堆栈上的Rails 3的地方。下面

--UPDATE-- 按照要求由利奥·科雷亚是我users_controller.rb的片段

def signed_in_user 
    unless signed_in? 
     store_location 
     redirect_to (signin_url, notice: t("user.please")) 
    end 
    end 
+0

+1你解决了这个问题吗?如果是这样,那么修复是什么?我在Heroku有一个不同的问题,但我还没有得到任何帮助。 – Anthony 2013-06-12 19:45:57

回答

3

这似乎是一个语法错误,你可能会失去了一些东西像一个大括号或括号

/app/app/controllers/users_controller.rb:54: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' (SyntaxError) 
2013-05-10T17:13:21.460325+00:00 app[web.1]:   redirect_to signin_url, notice: t "user.please" 

该块可以将它分开。因此,在上线54尝试的users_controller地方这样做

redirect_to(signing_url, notice: t('user.please')) 
+0

嗨。我修好了,重新点燃了。它仍然不起作用 – muyiwamat 2013-05-10 19:05:12

+0

错误仍然是一样的吗?如果不更新你的答案。 – 2013-05-10 19:05:55

+0

错误消息是一样的 – muyiwamat 2013-05-10 19:18:00

1

我认为这是资产的问题预编译,你需要在config/application.rb添加config.assets.initialize_on_precompile = false。如果在config/environments/production.rb

添加从您的日志似乎语法错误,如:您正在使用

redirect_to(signing_url, notice: t('user.please')) 

我觉得Devise Gem检查你的代码。

+0

不,我没有使用设计宝石。身份验证是从零开始的。另外,在我的production.rb中没有'config.assets.initialize_on_precompile = false'这样的行,我仍然应该将它添加到application.rb中吗? – muyiwamat 2013-05-10 19:30:27

0

您可以使用heroku免费账户。当您使用heroku的免费帐户时,您每天只能使用18小时,然后自动进入睡眠状态或疲惫不堪。当它发生时,你会得到这个错误页面。如果您的网站很忙,请尝试跳过这个帐户到业余爱好类型。

+0

Heroku于2015年开始减少免费游戏机的使用时间至每天18小时。问题出自2013年,所以我不认为这是问题所在。 – Daniel 2016-03-17 10:59:46

+0

是的,这是正确的丹妮..其实我发布这为当前用户的英雄..因为我自己遇到了问题,当它枯竭。在某些情况下,它可能对某人有用。 – 2016-03-18 05:22:06