I have the following in my config.ru
file and which crashes Heroku with the error underneath it.
require ::File.expand_path('../config/environment', __FILE__)
run Picasa::Application
require 'resque/server'
run Rack::URLMap.new \
"/" => Picasa::Application,
"/resque" => Resque::Server.new
Error:
2011-10-17T13:54:01+00:00 heroku[web.1]: Starting process with command `thin -p 30071 -e production -R /home/heroku_rack/hero开发者_StackOverflow社区ku.ru start`
2011-10-17T13:54:06+00:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/railties-3.0.9/lib/rails/application.rb:168:in `call': undefined method `reverse_merge!' for #<Rack::URLMap:0x7fd215e4f720> (NoMethodError)
2011-10-17T13:54:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.9/lib/rails/application.rb:77:in `send'
2011-10-17T13:54:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.9/lib/rails/application.rb:77:in `method_missing'
2011-10-17T13:54:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.3/lib/rack/builder.rb:73:in `to_app'
2011-10-17T13:54:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:23:in `inject'
2011-10-17T13:54:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.3/lib/rack/builder.rb:73:in `each'
2011-10-17T13:54:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.3/lib/rack/builder.rb:73:in `inject'
2011-10-17T13:54:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.3/lib/rack/builder.rb:73:in `to_app'
2011-10-17T13:54:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.3/lib/rack/builder.rb:63:in `map'
2011-10-17T13:54:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:18
2011-10-17T13:54:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.3/lib/rack/builder.rb:46:in `instance_eval'
2011-10-17T13:54:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.3/lib/rack/builder.rb:46:in `initialize'
2011-10-17T13:54:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:11:in `new'
2011-10-17T13:54:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:11
2011-10-17T13:54:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.3/lib/rack/builder.rb:46:in `instance_eval'
2011-10-17T13:54:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/rack-1.2.3/lib/rack/builder.rb:46:in `initialize'
2011-10-17T13:54:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:1:in `new'
2011-10-17T13:54:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:1
2011-10-17T13:54:06+00:00 heroku[web.1]: Process exited
2011-10-17T13:54:08+00:00 heroku[web.1]: State changed from starting to crashed
It looks like you're running Rails 3.0.9 in which case all you need do is
mount Resque::Server.new, :at => "/resque"
in your routes.rb file.
精彩评论