heroku Application Error

将代码push到heroku中后出现下面错误:

Application Error

An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details.

可以使用命令:

1heroku logs

查看具体到问题.
查看日志如下:

1        /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- coderay (LoadError)
2        2011-04-29T08:44:52+00:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
3        2011-04-29T08:44:52+00:00 app[web.1]:   from config.ru:4
4        2011-04-29T08:44:52+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23
5        2011-04-29T08:44:52+00:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `instance_eval'
6        2011-04-29T08:44:52+00:00 app[web.1]:   from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `initialize'

注意第三行: from config.ru:4

这是问题所在.查看源代码如下:

1  require 'toto'
2  require 'extends'
3  # Syntax Highlighting
4  require 'coderay'
5  require 'rack/codehighlighter'
6  use Rack::Codehighlighter, :coderay, :markdown => true, 
7      :theme => "active4d", :lines => true, :element => "pre>code", 
8      :pattern => /\A:::(\w+)\s*(\n|
)/, :logging => true

第四行是 require 'coderay'.说明coderay库加载有问题.将其注释掉即可.

可是为什么会出现这个问题呢?难道heroku找不到coderay这个库吗?请看这里:神奇的.gems

Powered by Engin & toto

comments powered by Disqus