sferik / twitter-ruby

A Ruby interface to the Twitter API.
http://www.rubydoc.info/gems/twitter
MIT License
4.58k stars 1.31k forks source link

Update in reply to seems to not work - returns wrong number of arguments error #923

Closed DavidLangva closed 6 years ago

DavidLangva commented 6 years ago

The error:

ArgumentError (wrong number of arguments (given 2, expected 1)): 18:08:26 web.1 |
18:08:26 web.1 | app/controllers/tweets_controller.rb:22:in `update'

The code on line 22 which is causing this error: client.update("I'm tweeting with @gem!", in_reply_to_status_id: 402712877960019968)

I also tried this and received the same error.: client.update("I'm tweeting with @gem!", {in_reply_to_status_id: 402712877960019968})

I took the code straight from the documentation to make sure it just wasn't an error with my variables.

Also, posting a regular update works and streaming with filter works.

DavidLangva commented 6 years ago

I was reusing the client. When I tried making a new client instance on every request, it worked as expected.