Ruby バージョン: 2.0.0-p0 Mac - Mountain Lion
以下は私のコードです(tw_stream_track.rb):
require 'tweetstream'
TweetStream.configure do |config|
config.consumer_key = 'xxxxxxxxxxxxxxx'
config.consumer_secret = 'xxxxxxxxxxxxxxx'
config.oauth_token = 'xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxx'
config.oauth_token_secret = 'xxxxxxxxxxxxxxx'
config.auth_method = :oauth
end
client = TweetStream::Client.new
client.on_error do |message|
puts message
end
client.track('apple', 'microsoft', 'samsung') do |status|
puts "#{status.text}"
end
ターミナルから実行すると:
ruby tw_stream_track.rb
私は以下を取得します:
/Users/mine/.rvm/gems/ruby-2.0.0-p0/gems/tweetstream-2.5.0/lib/tweetstream/client.rb:436:in `block in connect': Failed to reconnect after 11 tries. (TweetStream::ReconnectError)
from /Users/mine/.rvm/gems/ruby-2.0.0-p0/gems/em-twitter-0.2.2/lib/em-twitter/connection.rb:296:in `call'
from /Users/mine/.rvm/gems/ruby-2.0.0-p0/gems/em-twitter-0.2.2/lib/em-twitter/connection.rb:296:in `invoke_callback'
from /Users/mine/.rvm/gems/ruby-2.0.0-p0/gems/em-twitter-0.2.2/lib/em-twitter/connection.rb:268:in `rescue in schedule_reconnect'
from /Users/mine/.rvm/gems/ruby-2.0.0-p0/gems/em-twitter-0.2.2/lib/em-twitter/connection.rb:263:in `schedule_reconnect'
from /Users/mine/.rvm/gems/ruby-2.0.0-p0/gems/em-twitter-0.2.2/lib/em-twitter/connection.rb:93:in `unbind'
from /Users/mine/.rvm/gems/ruby-2.0.0-p0/gems/eventmachine-1.0.3/lib/eventmachine.rb:1440:in `event_callback'
from /Users/mine/.rvm/gems/ruby-2.0.0-p0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
from /Users/mine/.rvm/gems/ruby-2.0.0-p0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
from /Users/mine/.rvm/gems/ruby-2.0.0-p0/gems/tweetstream-2.5.0/lib/tweetstream/client.rb:388:in `start'
from /Users/mine/.rvm/gems/ruby-2.0.0-p0/gems/tweetstream-2.5.0/lib/tweetstream/client.rb:131:in `filter'
from /Users/mine/.rvm/gems/ruby-2.0.0-p0/gems/tweetstream-2.5.0/lib/tweetstream/client.rb:98:in `track'
これは私が tweetstream を使用するのは初めてであり、ドキュメントから、これが私がやっていることになっているようです。私は何が欠けていますか?