Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find out why a gem bundle has locked a gem at a specific version?

Tags:

ruby

bundler

gem

I'm trying to specify a version of the thrift gem in my gem file.

gem 'thrift', "~> 0.6.0"

When I trying to run bundle install, I get this error:

You have requested:
  thrift ~> 0.6.0

The bundle currently has thrift locked at 0.5.0.
Try running `bundle update thrift`

How can I find out what is causing it to be locked at the earlier version? Would it be in the requirements of another gem I have listed in the gem file?

Or is it just being caused by the fact that the installed version is 0.5.0, and specifying a version in the gem file won't update an installed gem?

like image 567
ben Avatar asked Mar 08 '11 11:03

ben


People also ask

How do you update a gem to a specific version?

The correct way to update the version of a gem to a specific version is to specify the version you want in your Gemfile, then run bundle install . As for why your command line was failing, there is no -version option.

What is a Gemfile lock file?

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 check my bundle version?

To view this information: Open the App bundle explorer page (Release > App bundle explorer). Select the version filter near the top right of the page. On the “Choose a version” table, select the right arrow on the version that you want to view.

How do I remove gem from Gemfile lock?

You can run just bundle or bundle install to install gems based on your Gemfile. That will remove the instance of mygem from your Gemfile. lock file.


1 Answers

Turns out just running bundle update thrift will show you what is locking the version:

$ bundle update thrift

Fetching source index for http://rubygems.org/
Bundler could not find compatible versions for gem "thrift":
  In Gemfile:
    evernote depends on
      thrift (~> 0.5.0)

    thrift (0.6.0)
like image 155
ben Avatar answered Sep 28 '22 08:09

ben