September 8, 2013, 5:21pm
Unable to verify your credentials
At least consumer key and secret are required, and that’s easy to fix:
Register your application with twitter
Put consumer key and secret into environment variables:
GitHub - bkeepers/dotenv: A Ruby gem to load environment variables from `.env`. instead
Add the following to
Twitter.configure do |config|
config.consumer_key = ENV['CONSUMER_KEY']
config.consumer_secret = ENV['CONSUMER_SECRET']
September 20, 2013, 8:49am
Please note that this is not working with newer version of twitter gem (version 5), so make sure to use 4.8.1 and it will work.
Also at first glance it looks that twitter gem API has been changed, so make sure to use version 4.8.1 if you are working on TDD workshop.
Hi wik, thanks for your post. I’m doing the TDD workshop and I’m stuck on this Twitter::Error::Forbidden error
Someting is not clear to me, in what file do I need to put those environment variables?
Thanks for your help,
solved it with the .dotenv gem
November 17, 2013, 10:56am
just type the following within your current bash session before running the specs:
or prepend to the actual command, e.g.:
CONSUMER_KEY=123 CONSUMER_SECRET=secret bundle exec rails s
But yeah, dotenv is a solid solution
December 27, 2013, 11:39pm
Thanks very much. Your suggestions worked for me, even rather quickly.
Ah, what a world: create a application authentication, hide it from the app, configure the gem.
Then, only then do we ge the tweets.
@patrikbona: The v5 of the twitter gem breaks almost everything that was working in v4.
June 14, 2014, 5:44pm
It should be noted that the consumer_key and consumer_secret are called the API key and API secret in today’s (2014-06-14) version of creating your twitter application.