I am using the ruby twitter gem and oauth to gain access to users twitter accounts. In my code, I have:
unless @user.twitter_authd? oauth = Twitter::O
If you're getting error 401 - OAuth::Unauthorized, make sure you edit the settings of your Twitter application as follows: