Bundler Could Not Find Compatible Versions for Gem "Bundler":

Bundler could not find compatible versions for gem bundler:

First verify your versions to be sure they're all current:

$ ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]

$ rails -v
Rails 3.2.2

$ gem list bundler
*** LOCAL GEMS ***
bundler (1.1.3)

If you need to update ruby, you can download it from https://www.ruby-lang.org or use tools like ruby-build. If you have any version of Ruby 1.9.3 that's fine for now.

To update all your gems:

gem update --system
gem update

Gem may install gems in a few different places, and these can interfere with each other. There are system gems (typically installed by root or by using sudo) and your personal user gems. My favorite way to manage these is with a simple tool called rbenv. A related tool is rvm. Either is fine.

For your first tutorial, you can skip using version numbers in your Gemfile:

- gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
+ gem 'sqlite3-ruby', :require => 'sqlite3'

Bundler will sort everything out the right way. Eventually you'll want to specify version numbers if you're coordinating with other developers, or building production systems.

Feel free to ask questions here and I'll add to this answer.

Bundle install could not find compatible versions for gem bundler

Your bundler gem is too big. You can downgrade for now by changing your gemfile to specify the lower version, and deleting the lock file again.

gem 'bundler', '1.17.1' 

Then try these commands in the terminal

gem install bundler -v 1.17.1
gem uninstall bundler -v 2.0.1
bundle update --bundler
bundle install

That last install command might be redundant. I'm on my phone so I can't test anything unfortunately.

Best of luck!

EDIT:

This is now a Heroku issue. Got it. Heroku docs regarding Bundler

Libraries
The following libraries are used by the platform for managing and running >Ruby applications and cannot be specified. For application dependency resolution and management, bundler is installed based on the contents of your Gemfile.lock. If you have a BUNDLED WITH in your Gemfile.lock then you will receive a different version of Bundler:

Applications specifying Bundler 2.x in their Gemfile.lock will receive bundler: 2.0.1
Applications specifying Bundler 1.x in their Gemfile.lock will receive bundler: 1.15.2
Applications with no BUNDLED WITH in their Gemfile.lock will default to bundler: 1.15.2
For more information on available settings see Bundler configuration. For more information on why we only support a specific set of bundler versions, please see this article about your Bundler version.

So it seems like Heroku only allows certain versions of Bundler to be compatible, relevant doc is linked. Downgrade to 1.15.2 and give it another shot.

Bundler could not find compatible versions for gem. The version is within range

It was because of this line:

gem 'flip', '~>1.1', :git => 'https://github.com/pda/flip.git'

When commented, it works. When uncommented, it spits out nonsensical errors and buried in the errors is this:

Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
flip (~> 1.1) was resolved to 1.1.1, which depends on
activesupport (>= 4.0, <= 5.2)

rails (~> 5.2.6) was resolved to 5.2.6, which depends on
activesupport (= 5.2.6)

I think that is the ONLY error it should have printed out, but that is probably a bug in Bundler. Now I must manually implement that Gem or think of a monkey patch. (I dislike unnecessary and superficial dependencies.)



Related Topics



Leave a reply



Submit