In my application, I provide users with tweets with the following code:
if twitter = current_user.authentications.find_by_provider("twitter") Twitter.configure do |tw| tw.consumer_key = "6jaqMt7kE9iVxh8hX0mmtQ" tw.consumer_secret = "5ZIydxRBFfEJxc2EzedahIxoeO8g1hZCQVqZFtWWNM" tw.oauth_token = twitter.token tw.oauth_token_secret = twitter.token_secret end Twitter.update(params[:tweet])
It works well in my localhost. However, now I have deployed my application to heroku and I am trying to send tweets, but in heroku logs it says:
2012-11-15T01:30:32+00:00 app[web.1]: Completed 500 Internal Server Error in 494ms 2012-11-15T01:30:32+00:00 app[web.1]: 2012-11-15T01:30:32+00:00 app[web.1]: Twitter::Error::BadRequest (Bad Authentication data): 2012-11-15T01:30:32+00:00 app[web.1]: 2012-11-15T01:30:32+00:00 app[web.1]: 2012-11-15T01:30:32+00:00 app[web.1]: app/controllers/posts_controller.rb:12:in `create'
What should I do to solve this problem?
Thanks.
source share