Rails / heroku:如何让我的应用程序在heroku上工作

时间:2011-11-25 17:34:19

标签: ruby-on-rails heroku

我有一个rails(2.3.5)应用程序,我不得不对它进行一些更改,涉及更改数据库。所以,本地它工作正常,但是当我试图将它推送到heroku时,当我尝试访问应用程序时,我的浏览器上出现“应用程序错误”。我推送了新代码,引导并用我的本地项目填充了heroku数据库。

这是我用“heroku日志”得到的,任何想法? :

C:\Sites\takenetqd>heroku logs
2011-11-25T15:54:04+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:413:in `each'
2011-11-25T15:54:04+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:413:in `load_application_classes'
2011-11-25T15:54:04+00:00 app[web.1]:    ... 21 levels...
2011-11-25T15:54:04+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `instance_eval'
2011-11-25T15:54:04+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `initialize'
2011-11-25T15:54:04+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1:in `new'
2011-11-25T15:54:04+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1
2011-11-25T15:54:04+00:00 heroku[web.1]: Process exited
2011-11-25T15:54:05+00:00 heroku[web.1]: State changed from starting to crashed
2011-11-25T16:04:36+00:00 heroku[web.1]: State changed from crashed to created
2011-11-25T16:04:36+00:00 heroku[web.1]: State changed from created to starting
2011-11-25T16:04:37+00:00 heroku[web.1]: Starting process with command `thin -p 50841 -e production -R /home/heroku_rack/heroku.ru start`
2011-11-25T16:04:39+00:00 app[web.1]: /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': /app/app/controllers/
sms_controller.rb:232: syntax error, unexpected $end, expecting kEND (SyntaxError)
2011-11-25T16:04:39+00:00 app[web.1]:   from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
2011-11-25T16:04:39+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'

2011-11-25T16:04:39+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:265:in `require_
or_load'
2011-11-25T16:04:39+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:224:in `depend_o
n'
2011-11-25T16:04:39+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:136:in `require_
dependency'
2011-11-25T16:04:39+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:414:in `load_application_classes'
2011-11-25T16:04:39+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:413:in `each'
2011-11-25T16:04:39+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:413:in `load_application_classes'
2011-11-25T16:04:39+00:00 app[web.1]:    ... 21 levels...
2011-11-25T16:04:39+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `instance_eval'
2011-11-25T16:04:39+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `initialize'
2011-11-25T16:04:39+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1:in `new'
2011-11-25T16:04:39+00:00 heroku[web.1]: Process exited
2011-11-25T16:15:09+00:00 heroku[web.1]: State changed from crashed to created
2011-11-25T16:15:09+00:00 heroku[web.1]: State changed from created to s
tarting
2011-11-25T16:15:10+00:00 heroku[web.1]: Starting process with command `thin -p 53066 -e production -R /home/heroku_rack/heroku.ru start`
2011-11-25T16:15:12+00:00 app[web.1]: /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': /app/app/controllers/
sms_controller.rb:232: syntax error, unexpected $end, expecting kEND (SyntaxError)
2011-11-25T16:15:12+00:00 app[web.1]:   from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
2011-11-25T16:15:12+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'

2011-11-25T16:15:12+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:265:in `require_
or_load'
2011-11-25T16:15:12+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:224:in `depend_o
n'
2011-11-25T16:15:12+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:136:in `require_
dependency'
2011-11-25T16:15:12+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:414:in `load_application_classes'
2011-11-25T16:15:12+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:413:in `each'
2011-11-25T16:15:12+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:413:in `load_application_classes'
2011-11-25T16:15:12+00:00 app[web.1]:    ... 21 levels...
2011-11-25T16:15:12+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `instance_eval'
2011-11-25T16:15:12+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `initialize'
2011-11-25T16:15:12+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1:in `new'
2011-11-25T16:15:12+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1
2011-11-25T16:15:12+00:00 heroku[web.1]: Process exited
2011-11-25T16:15:13+00:00 heroku[web.1]: State changed from starting to crashed
2011-11-25T16:25:13+00:00 heroku[web.1]: State changed from crashed to created
2011-11-25T16:25:13+00:00 heroku[web.1]: State changed from created to starting
2011-11-25T16:25:20+00:00 app[web.1]: /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': /app/app/controllers/
sms_controller.rb:232: syntax error, unexpected $end, expecting kEND (SyntaxError)
2011-11-25T16:25:20+00:00 app[web.1]:   from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
2011-11-25T16:25:20+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'

2011-11-25T16:25:20+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.
3.5/lib/active_support/dependencies.rb:265:in `require_or_load'
2011-11-25T16:25:20+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:224:in `depend_o
n'
2011-11-25T16:25:20+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:136:in `require_
dependency'
2011-11-25T16:25:20+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:414:in `load_application_classes'
2011-11-25T16:25:20+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:413:in `each'
2011-11-25T16:35:48+00:00 heroku[web.1]: State changed from crashed to created
2011-11-25T16:35:49+00:00 heroku[web.1]: State changed from created to starting
2011-11-25T16:35:50+00:00 heroku[web.1]: Starting process with command `thin -p 38632 -e production -R /home/heroku_rack/heroku.ru start`
2011-11-25T16:35:52+00:00 app[web.1]: /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': /app/app/controllers/
sms_controller.rb:232: syntax error, unexpected $end, expecting kEND (SyntaxError)
2011-11-25T16:35:52+00:00 app[web.1]:   from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
2011-11-25T16:35:52+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'

2011
-11-25T16:35:52+00:00 app[web.1]:       from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:224:in `depend_o
n'
2011-11-25T16:35:52+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:265:in `require_
or_load'
2011-11-25T16:35:52+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:136:in `require_
dependency'
2011-11-25T16:35:52+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:414:in `load_application_classes'
2011-11-25T16:35:52+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:413:in `each'
2011-11-25T16:35:52+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:413:in `load_application_classes'
2011-11-25T16:35:52+00:00 app[web.1]:    ... 21 levels...
2011-11-25T16:35:52+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `instance_eval'
2011-11-25T16:35:52+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `initialize'
2011-11-25T16:35:52+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1:in `new'
2011-11-25T16:35:52+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1
2011-11-25T16:35:52+00:00 heroku[web.1]: Process exited
2011-11-25T16:35:53+00:00 heroku[web.1]: State changed from starting to crashed
2011-11-25T16:46:58+00:00 heroku[web.1]: State changed from crashed to created
2011-11-25T16:46:58+00:00 heroku[web.1]: State changed from created to starting
2011-11-25T16:47:00+00:00 heroku[web.1]: Starting process with command `thin -p 53480 -e production -R /home/heroku_rack/heroku.ru start`
2011-11-25T16:47:03+00:00 heroku[web.1]: State changed from starting to crashed
2011-11-25T16:57:38+00:00 heroku[web.1]: State changed from crashed to created
2011-11-25T16:57:38+00:00 heroku[web.1]: State changed from created to starting
2011-11-25T16:57:43+00:00 heroku[web.1]: State changed from starting to crashed
2011-11-25T17:07:44+00:00 heroku[web.1]: State changed from crashed to created
2011-11-25T17:07:44+00:00 heroku[web.1]: State changed from created to starting
2011-11-25T17:07:45+00:00 heroku[web.1]: Starting process with command `thin -p 6130 -e production -R /home/heroku_rack/heroku.ru start`
2011-11-25T17:07:47+00:00 app[web.1]: /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': /app/app/controllers/
sms_controller.rb:232: syntax error, unexpected $end, expecting kEND (SyntaxError)
2011-11-25T17:07:47+00:00 app[web.1]:   from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
2011-11-25T17:07:47+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'

2011-11-25T17:07:47+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:265:in `require_
or_load'
2011-11-25T17:07:47+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:224:in `depend_o
n'
2011-11-25T17:07:47+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:136:in `require_
dependency'
2011-11-25T17:07:47+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:414:in `load_application_classes'
2011-11-25T17:07:47+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:413:in `each'
2011-11-25T17:07:47+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:413:in `load_application_classes'
2011-11-25T17:07:47+00:00 app[web.1]:    ... 21 levels...
2011-11-25T17:07:47+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `instance_eval'
2011-11-25T17:07:47+00:00 app[web.1]:   from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `initialize'
2011-11-25T17:07:47+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1:in `new'
2011-11-25T17:07:47+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:1
2011-11-25T17:07:47+00:00 heroku[web.1]: Process exited
2011-11-25T17:07:48+00:00 heroku[web.1]: State changed from starting to crashed

2 个答案:

答案 0 :(得分:2)

看起来你的一个控制器中存在语法错误:

sms_controller.rb:232: syntax error, unexpected $end, expecting kEND (SyntaxError)

答案 1 :(得分:1)

查看您的短信控制器并确保每个def [1]已关闭,并end

日志文件不一定是令人生畏的。请注意,关键信息是在应用程序创建然后启动后声明的,因为这是问题开始的地方,最重要的信息更接近顶部。之后的第一行说明了语法错误。所有后续行都是错误,一旦修复了最高错误,这些错误就会消失。

[1]不一定是def - 可以是块,循环,迭代等。