2013-03-07 59 views
0

我想使用紅寶石'微博',但由於未知的原因它不起作用。 下面是運行腳本時出現錯誤:Ruby Gem Twitter - 錯誤::客戶端錯誤:初始化:名稱或服務未知

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

我註冊了我的應用程序在我的Twitter開發者帳戶並安裝了寶石。 這裏是我的編碼(我刪除了所有鍵):

require 'twitter'

client = Twitter::Client.new(

:consumer_key => "",

:consumer_secret => "",

:oauth_token => "",

:oauth_token_secret => ""

)

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

我也嘗試了做這樣的:

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

..它不:-(工作..我一個新手到紅寶石,所以也許我忘了...... 我真的很期待你的回答。提前謝謝你!!!

回答

0

我認爲這是一個代理問題。將它部署到雲後它工作!

相關問題