Configure Twitter Gem on Ruby
I'm trying to get the Twitter Gem working in a simple Ruby script, but am
having trouble just setting the configuration.
require 'rubygems'
require 'twitter'
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
Twitter.update("I'm tweeting with @gem!")
Every time I try to run this code from terminal using 'ruby twitter.rb' I
get back the following error
tweet2.rb:8: syntax error, unexpected tCONSTANT, expecting keyword_end
Line 8 would be
config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET
I don't understand why keyword_end would be expected here. Can anyone help
me out?
By the way I'm using ruby 1.9.2p320
No comments:
Post a Comment