运行CloudKit示例时出错

时间:2012-02-05 22:18:44

标签: rack

尝试运行最基本的Cloudkit示例时出现以下错误,如http://getcloudkit.com/curl.html所示:

 /Users/ed/.rvm/gems/ruby-1.9.2-p180/gems/cloudkit-0.11.2/lib/cloudkit/rack/builder.rb:43
 :in `expose': undefined method `<<' for nil:NilClass (NoMethodError)   
 from /Users/ed/Work/Play/config.ru:3:in `block in <main>'

from /Users/ed/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /Users/ed/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from /Users/ed/Work/Play/config.ru:1:in `new'
from /Users/ed/Work/Play/config.ru:1:in `<main>'
from /Users/ed/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
from /Users/ed/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
from /Users/ed/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
from /Users/ed/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
from /Users/ed/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
from /Users/ed/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.4.1/lib/rack/server.rb:137:in `start'
from /Users/ed/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.4.1/bin/rackup:4:in `<top (required)>'
from /Users/ed/.rvm/gems/ruby-1.9.2-p180/bin/rackup:19:in `load'
from /Users/ed/.rvm/gems/ruby-1.9.2-p180/bin/rackup:19:in `<main>'

任何想法可能是什么?

1 个答案:

答案 0 :(得分:0)

您可能安装了一个大于1.4的Rack版本 CloudKit不支持Rack 1.4。

快速修复

$ gem uninstall -v '>=1.4' rack
$ gem install rack -v 1.3.6

<强>更新

另一个解决方案是通过不使用rack来指定要加载的rackup版本,但是这个内联命令:

$ gem install rack -v 1.3.6
$ ruby -e "gem 'rack', '=1.3.6'; require 'rack'; Rack::Server.start" config.ru