0

我必须在我的 rake 任务中使用 websockets,为此我将event.rb更改为

 config.synchronize = true  
  # Uncomment and edit to point to a different redis instance.
  # Will not be used unless standalone or synchronization mode
  # is enabled.
 config.redis_options = {:host => 'localhost', :port => '3000'}

当我启动我的rails服务器时,我收到了这个错误:

! Invalid request
Exiting
/usr/local/rvm/gems/ruby-1.9.3-p194@socialmail/gems/redis-3.0.4/lib/redis/connection/synchrony.rb:115:in `read':  Got 'Protocol error, got "H" as reply type byte' as initial reply byte. If you're in a forking environment, such as Unicorn, you need to connect to Redis after forking.  (Redis::ProtocolError)

我究竟做错了什么?

谢谢

4

1 回答 1

0

嘿,谢谢你的问题,我个人无法将我的 rake 任务发布到我在 Rails 服务器上打开的 websocket 频道。您的同步命令有所帮助(以及在本地启动 Redis 服务器)。

您的问题 - 似乎您指向 3000。那是您的 rails 服务器还是 Redis 实例?如果您在本地运行它,我会省略该行。

于 2013-08-22T14:57:46.643 回答