我正在关注 railscast 并完全按照说明进行操作。我什至使用net.tutsplus 的faye.ru 代码在根目录下设置了faye.ru 文件。
这是 faye.ru 文件:
require 'faye'
faye_server = Faye::RackAdapter.new(:mount => '/faye', :timeout => 45)
run faye_server
当我尝试使用启动服务器时rackup faye.ru -s thin -E production
,
我收到以下错误:
/Users/TonyNg/faye-tutorial/faye.ru:3:in `block in <main>': undefined local variable or method ` ' for #<Rack::Builder:0x00000100918420 @ins=[]> (NameError)
from /Users/TonyNg/.rvm/gems/ruby-1.9.3-p0@rails313/gems/rack-1.3.5/lib/rack/builder.rb:51:in `instance_eval'
from /Users/TonyNg/.rvm/gems/ruby-1.9.3-p0@rails313/gems/rack-1.3.5/lib/rack/builder.rb:51:in `initialize'
from /Users/TonyNg/faye-tutorial/faye.ru:1:in `new'
from /Users/TonyNg/faye-tutorial/faye.ru:1:in `<main>'
from /Users/TonyNg/.rvm/gems/ruby-1.9.3-p0@rails313/gems/rack-1.3.5/lib/rack/builder.rb:40:in `eval'
from /Users/TonyNg/.rvm/gems/ruby-1.9.3-p0@rails313/gems/rack-1.3.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/TonyNg/.rvm/gems/ruby-1.9.3-p0@rails313/gems/rack-1.3.5/lib/rack/server.rb:200:in `app'
from /Users/TonyNg/.rvm/gems/ruby-1.9.3-p0@rails313/gems/rack-1.3.5/lib/rack/server.rb:301:in `wrapped_app'
from /Users/TonyNg/.rvm/gems/ruby-1.9.3-p0@rails313/gems/rack-1.3.5/lib/rack/server.rb:252:in `start'
from /Users/TonyNg/.rvm/gems/ruby-1.9.3-p0@rails313/gems/rack-1.3.5/lib/rack/server.rb:137:in `start'
from /Users/TonyNg/.rvm/gems/ruby-1.9.3-p0@rails313/gems/rack-1.3.5/bin/rackup:4:in `<top (required)>'
from /Users/TonyNg/.rvm/gems/ruby-1.9.3-p0@rails313/bin/rackup:19:in `load'
from /Users/TonyNg/.rvm/gems/ruby-1.9.3-p0@rails313/bin/rackup:19:in `<main>'
它似乎只适用于瑞安,但我不走运。