0
我正在使用Turntabler,這是一個用於與turntable.fm進行交互的Ruby gem。我創造了這個簡單的「Hello World」程序:使用Turntabler獲取消息「調試 - :連接失敗:連接未打開」
require 'turntabler'
require_relative 'config.rb'
config = KevbotConfiguration.load_config # Reads a YAML file
Turntabler.run(config[:email], config[:password], :room => config[:room], :reconnect => true, :reconnect_wait => 30) do
on :user_spoke do |message|
# Respond to "/hello" command
if (message.content =~ /^\/hello$/)
room.say("Hey! How are you @#{message.sender.name}?")
end
end
end
當我運行這個程序時,出現此消息:
$ ruby src/main.rb
D, [2013-11-09T15:57:17.602019 #10407] DEBUG -- : Connection failed: Connection is not open
D, [2013-11-09T15:57:47.634282 #10407] DEBUG -- : Attempting to reconnect
D, [2013-11-09T15:57:47.719336 #10407] DEBUG -- : Connection failed: Connection is not open
D, [2013-11-09T15:58:17.744107 #10407] DEBUG -- : Attempting to reconnect
D, [2013-11-09T15:58:17.828378 #10407] DEBUG -- : Connection failed: Connection is not open
D, [2013-11-09T15:58:47.854309 #10407] DEBUG -- : Attempting to reconnect
# etc.
我能做些什麼來解決這個問題?
編輯:這是config.rb
內容:
module KevbotConfiguration
require 'yaml'
def self.load_config
return YAML.load_file('config.yaml')
end
end