jnunemaker/twitter — Issue #211: 401: Invalid / expired Token. Twitter gem (ruby 1.9.2)
Author: Venilotov-Alexander
Created: 2011-11-15 14:17:39+00:00
State: open

I have some problems with twitter gem and somehow it depends of ruby version. In 1.8.7 everything works fine, but in 1.9.2 does not. Here are my steps: I create new rails app with twitter gem, then try to configure client:

rails c
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

client ||= Twitter::Client.new
user = client.user

And result is
"Twitter::Unauthorized: GEThttps://api.twitter.com/1/account/verify_credentials.json: 401: Invalid / expired Token"

With 1.8.7 everything is okey. I have tested this with Mac OS 10.6, Ubuntu 11.10 - same problem. To update ruby version i use rvm. Any ideas what is wrong?