Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails, Installed Gem version and Gemfile.lock version

I have a problem.

Gemfile.lock is always committed if bundle is updated.

And today, when I deploy web application, I see this error message,

Could not find jwt-1.5.3 in any of the sources

jwt-1.5.2 is installed in deployed server at shared gem path.

I think bundle install new jwt-1.5.3 gem because the specified version (1.5.3) in Gemfile.lock and installed version (1.5.2) is not equal.

Why cannot bundle install jwt gem?

Should bundle install that gem if Could not find jwt-1.5.3?

like image 424
myggul Avatar asked Mar 25 '16 09:03

myggul


People also ask

What is Gemfile lock in Rails?

The Gemfile. lock allows you to specify the versions of the dependencies that your application needs in the Gemfile , while remembering all of the exact versions of third-party code that your application used when it last worked correctly. By specifying looser dependencies in your Gemfile (such as nokogiri ~> 1.4.

How do I specify a Gemfile version?

There are several ways to specify gem versions: Use a specific version: gem "name-of-gem", "1.0" . You can find specific versions on Rubygems.org (provided that's the source you”re using) by searching for your gem and looking at the “Versions” listed. Use a version operator: gem "name-of-gem", ">1.0" .

What will happen if we do not put Gemfile lock in github?

No Gemfile. lock means: new contributors cannot run tests because weird things fail, so they won't contribute or get failing PRs ...


2 Answers

Delete the Gemfile.lock file. Then bundle install again. Hopefully it will install again with jwt-1.5.3. But make sure you have mentioned the version of jwt in gem file.

like image 90
Mohammad Shahadat Hossain Avatar answered Oct 01 '22 04:10

Mohammad Shahadat Hossain


Oh.. I know why.

https://rubygems.org/gems/jwt/versions/1.5.3

jwt 1.5.3 is yanked because of some reasons. So 1.5.3 version isn't in repository..!

like image 25
myggul Avatar answered Oct 01 '22 04:10

myggul