Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating a gem?

I'm using the twitter gem and it has a mistake in one the methods -- Twitter requires authentication and this method was set for fals for authentication. It seems someone fixed it with this commit ver recently:

https://github.com/jnunemaker/twitter/commit/4483ad062c5dd65b4adb13fb8da5efdaf550f35a#

But, when I use the method -- I still get an error:

Twitter::Unauthorized: GET https://api.twitter.com/1/statuses/retweets/{id}.json: 401: Could not authenticate you.

I tried updating the gem.

gem update twitter
Updating installed gems
Nothing to update

I tried also, updating the bundle, but no luck. So, I'm not sure how to get the new code into my bundle so it uses the method with authentication?

like image 716
Slick23 Avatar asked Feb 24 '23 16:02

Slick23


2 Answers

The commit you are linking to seems to be a documentation change only so getting it wouldn't probably help much. If you want to link to the latest git version of a gem you can put something like this in your gemfile:

gem "twitter", :git => "git://github.com/jnunemaker/twitter.git"

If you want to change a piece of the code just fork the repo on twitter and link to your own instead locally or on github.

Update: nowadays it is also possible to have a github reference in the gemfile:

gem "twitter", :github => "jnunemaker/twitter"
like image 154
froderik Avatar answered Mar 08 '23 13:03

froderik


As Pablo Fernandez noted, the commit you linked changed nothing, just a comment. Also, just because there's a commit, it does not mean that there's a new gem version released. You can try to switch your dependency on the Gemfile to the "live" version, though:

gem "twitter", :git => "git://github.com/jnunemaker/twitter.git"
like image 40
Fábio Batista Avatar answered Mar 08 '23 14:03

Fábio Batista