私のアプリでは、次のコードでツイートするユーザーを提供しています。
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])
それは私のローカルホストでうまく機能します。ただし、アプリをherokuにデプロイし、ツイートを送信しようとしていますが、herokuログには次のように表示されます。
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'
この問題を解決するにはどうすればよいですか?
ありがとう。