2012-06-09 54 views
1

我已經設置了我的王菲服務器,沿着我的rails服務器上運行,這樣的教程告訴我: http://net.tutsplus.com/tutorials/ruby/how-to-use-faye-as-a-real-time-push-server-in-rails/王菲,WebSocket連接問題:無法建立與WS連接://本地主機:9292 /王菲

不奇怪的行爲,直到我去掉該行

var client = new Faye.Client('http://localhost:9292/faye'); 

螢火蟲然後給我這個問題的標題錯誤。訪問本地主機:9292/faye和/faye.js給了我所期望的,並且(顯然)引用該.js文件的javascript_include_tag沒有任何問題。

我有,當我開始王菲使用捆綁高管,每此錯誤消息:

$ rackup ./config.ru -E production -s thin -p 9292 /Users/newcreation/.rvm/gems/[email protected]/gems/bundler-1.0.21/lib/bundler/runtime.rb:31:in ``block in setup': You have already activated rack 1.4.1, but your Gemfile requires rack 1.3.0. Using bundle exec may solve this. (Gem::LoadError)

我config.ru看起來是這樣的:

require 'rubygems' 
require 'bundler' 
Bundler.require 
require 'faye' 

require File.expand_path('../config/initializers/faye_token.rb', __FILE__) 

faye_server = Faye::RackAdapter.new(:mount => '/faye', :timeout => 45) 
run faye_server 

任何想法?

謝謝

回答

相關問題