ruby-on-rails - RabbitMQ 3.5.6 无法与任何配置的主机建立 TCP 连接 (Bunny::TCPConnectionFailedForAllHosts)

标签 ruby-on-rails rabbitmq bunny

我正在尝试连接到 RabbitMQ 服务器,但总是出现以下错误:

W, [2015-12-08T15:38:01.993251 #37405]  WARN -- #<Bunny::Session:0x7fe07b894f78 guest@localhost:5672, vhost=/dev_prod, addresses=[localhost:5672]>: An empty frame was received while opening the connection. In RabbitMQ <= 3.1 this could mean an authentication issue.


.../.rvm/gems/ruby-2.1.2/gems/bunny-2.2.0/lib/bunny/session.rb:315:in `rescue in start': Could not establish TCP connection to any of the configured hosts (Bunny::TCPConnectionFailedForAllHosts)

我在 MAC OS 上使用 Ruby 2.1.2、RabbitMQ 3.5.6。
抱歉,我是 RabbitMQ 的新手,只是尝试使用它但无法解决问题。
请给我一些建议。

最佳答案

这可能是因为您没有传递用户名和密码或传递错误的用户名和密码。

用户名和密码的默认值都是 guest 和 guest 。

尝试像这样初始化连接:

 conn = Bunny.new(host:  'localhost',
                  port:  '5672',
                  vhost: '/',
                  user:  'guest',
                  pass:  'guest')
 conn.start

看看会发生什么

关于ruby-on-rails - RabbitMQ 3.5.6 无法与任何配置的主机建立 TCP 连接 (Bunny::TCPConnectionFailedForAllHosts),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34151450/

相关文章:

ruby - RabbitMQ/兔子 : subscribe block not called if within a thread

ruby-on-rails - 如何正确使用belongs_to和has_many?

html - 在 Rails ERB 中混合 HTML 和非 HTML 字符串

java - Spring AMQP 的 "Cannot convert value of type"异常

.net - EasyNetQ 模型关闭

ruby - rabbitmq 在服务器重启后删除队列绑定(bind)

ruby-on-rails - 当我进行测试时,test_helper 不加载

java 4 更新后 osx 上的 java 字体格式异常

python - 使用Flower时如何查看经纪商信息?

ruby-on-rails-3 - 如何在 Rails 和 Thin 中启动兔子线程