Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network is unreachable - connect(2) for "199.16.156.217" #732

Closed
bobmshannon opened this issue Oct 5, 2015 · 1 comment
Closed

Network is unreachable - connect(2) for "199.16.156.217" #732

bobmshannon opened this issue Oct 5, 2015 · 1 comment

Comments

@bobmshannon
Copy link

I'm not sure if this is an issue with the gem or a networking issue on my side, but I've been having connection issues when trying to use the streaming API. I've tested this on multiple machines and received the same error shown below. Using the latest version of the twitter gem v5.15.0.

Any suggestions would be much appreciated.

Error

[vagrant@localhost vagrant]$ ruby twitter.rb
/usr/local/rvm/gems/ruby-2.2.1/gems/twitter-5.15.0/lib/twitter/streaming/connection.rb:16:in `initialize': Network is unreachable - connect(2) for "199.16.156.217" port  (Errno::ENETUNREACH)
    from /usr/local/rvm/gems/ruby-2.2.1/gems/twitter-5.15.0/lib/twitter/streaming/connection.rb:16:in `new'
    from /usr/local/rvm/gems/ruby-2.2.1/gems/twitter-5.15.0/lib/twitter/streaming/connection.rb:16:in `stream'
    from /usr/local/rvm/gems/ruby-2.2.1/gems/twitter-5.15.0/lib/twitter/streaming/client.rb:119:in `request'
    from /usr/local/rvm/gems/ruby-2.2.1/gems/twitter-5.15.0/lib/twitter/streaming/client.rb:58:in `sample'
    from twitter.rb:10:in `<main>'

twitter.rb

require 'twitter'

client = Twitter::Streaming::Client.new do |config|
    config.consumer_key       = 'HIDDEN'
    config.consumer_secret    = 'HIDDEN'
    config.access_token        = 'HIDDEN'
    config.access_token_secret = 'HIDDEN'
end

client.sample do |object|
  puts object.text if object.is_a?(Twitter::Tweet)
end

Ruby Version

[vagrant@localhost vagrant]$ ruby --version
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
@bobmshannon
Copy link
Author

Closing as this is a duplicate of #709.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant