I'm using Turntabler, a Ruby gem for interacting with turntable.fm. I created this simple "Hello World" program:
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
When I run this program, it fails with this message:
$ 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.
What can I do to fix this problem?
EDIT: This is the contents of config.rb
:
module KevbotConfiguration
require 'yaml'
def self.load_config
return YAML.load_file('config.yaml')
end
end