Ruby 对于heroku上的非rails应用程序,config.ru中有什么内容?

Ruby 对于heroku上的非rails应用程序,config.ru中有什么内容?,ruby,heroku,rack,resque,Ruby,Heroku,Rack,Resque,我有一个简单的ruby(非rails)应用程序,它使用resque,在heroku上没有config.ru就无法启动。添加config.ru文件时,在本地运行rackup时会出现以下错误: /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:133:in `to_app': missing run or map statement (RuntimeError) from

我有一个简单的ruby(非rails)应用程序,它使用resque,在heroku上没有config.ru就无法启动。添加config.ru文件时,在本地运行
rackup
时会出现以下错误:

/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:133:in `to_app': missing run or map statement (RuntimeError)
from /Users/nickkarrasch/Dropbox/Coding/Ruby/smsnotifyv2/config.ru:in `<main>'
from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:250:in `start'
from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:141:in `start'
from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/bin/rackup:4:in `<top (required)>'
from /usr/local/Cellar/ruby/1.9.3-p194/bin/rackup:23:in `load'
from /usr/local/Cellar/ruby/1.9.3-p194/bin/rackup:23:in `<main>'
/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:133:in'to_app':缺少运行或映射语句(运行时错误)
from/Users/nickkarasch/Dropbox/Coding/Ruby/smsnotifyv2/config.ru:in`'
from/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in'eval'
from/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in“new_from_string”
from/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:40:in“parse_file”
from/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:277:in“build\u app\u和\u options\u from\u config”
from/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:199:in'app'
from/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:314:in'wrapp'
from/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:250:在“开始”中
from/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:141:in'start'
from/usr/local/ceral/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-1.5.2/bin/rackup:4:in`'
from/usr/local/cillar/ruby/1.9.3-p194/bin/rackup:23:in'load'
from/usr/local/ceral/ruby/1.9.3-p194/bin/rackup:23:in`'
我需要在config.ru中放入什么?

该文件的内容(config.ru)将取决于您实际尝试执行的操作以及您正在使用的框架,因为该框架仅用于配置机架应用程序,它告诉
Rack::Builder
应该使用什么中间件以及使用的顺序。以下是Heroku文档中提供的一些示例:

西纳特拉

require './hello'
run Sinatra::Application
require ::File.expand_path('./../hello', __FILE__)
Ramaze.start(:file => __FILE__, :started => true)
run Ramaze
Ramaze

require './hello'
run Sinatra::Application
require ::File.expand_path('./../hello', __FILE__)
Ramaze.start(:file => __FILE__, :started => true)
run Ramaze
露营

require './hello'
run Rack::Adapter::Camping.new(Hello)