0
votes

I want to use the ruby gem 'twitter' but for an unknown reason it does not work. Here's the error I get when running the script:

C:/nwcloud/jruby-1.7.2/lib/ruby/gems/shared/gems/faraday-0.8.6/lib/faraday/reques/multipart.rb:5 warning: already initialized constant DEFAULT_BOUNDARY Twitter::Error::ClientError: initialize: name or service not known request at C:/nwcloud/jruby-1.7.2/lib/ruby/gems/shared/gems/twitter-4.5.0/lib/twitter/client.rb:85 get at C:/nwcloud/jruby-1.7.2/lib/ruby/gems/shared/gems/twitter-4.5.0/lib/twitter/client.rb:64 __send__ at org/jruby/RubyBasicObject.java:1671 send at org/jruby/RubyKernel.java:2094 cursor_from_response at C:/nwcloud/jruby-1.7.2/lib/ruby/gems/shared/gems/twitter-4.5.0/lib/twitter/api/utils.rb:108 cursor_from_response_with_user at C:/nwcloud/jruby-1.7.2/lib/ruby/gems/shared/gems/twitter-4.5.0/lib/twitter/api/utils.rb:96 friends at C:/nwcloud/jruby-1.7.2/lib/ruby/gems/shared/gems/twitter-4.5.0/lib/twitter/api/friends_and_followers.rb:314 (root) at tCon.rb:11

I registered my application in my twitter developer account and installed the gem. Here's my coding (I removed all keys):

require 'twitter'

client = Twitter::Client.new(

:consumer_key => "",

:consumer_secret => "",

:oauth_token => "",

:oauth_token_secret => ""

)

client.update("I'm tweeting with @gem!")`

I also tried just to do it like this:

Twitter.configure do |config|

config.consumer_key = YOUR_CONSUMER_KEY

config.consumer_secret = YOUR_CONSUMER_SECRET

config.oauth_token = YOUR_OAUTH_TOKEN

config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET

end

.. it doesn't work :-( .. I'm a newbie to ruby so perhaps I forgot sth... I'm really looking forward to your answers. Thank you in advance!!!

1

1 Answers

0
votes

I think it was a proxy problem. After deploying it to the cloud it worked!