Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bundler could not find compatible versions for gem "bundler": In Gemfile:

I'm making GitHub blog page with Jekyll. I've failed like numerous times and just forked new one and followed README on the repository.

It's https://github.com/janczizikow/sleek/blob/master/README.md and I tried to run inside the directory(master) but this msg keeps coming out.

I tried 'gem install bundler' 'gem cleanup' and similar solutions on the internet but still can't fix it. I get that I need another version which is lower one, then how can I remove the current one and install the version I need?

I've never used Ruby so I'm SO lost. A little advice will mean a lot.

bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    bundler (~> 1.12) x64-mingw32

  Current Bundler version:
    bundler (2.0.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Could not find gem 'bundler (~> 1.12)' in any of the relevant sources:
  the local ruby installation
like image 988
Alex Jang Avatar asked Jul 23 '19 18:07

Alex Jang


People also ask

How do I fix resolve bundler Cannot find compatible versions for gem?

lock and delete all references to the offending gem (in this case the faraday gem). Then run bundle install and it'll update the Gemfile. lock to have compatible versions of the gem where it needs. If you want to be extra safe you can go to the Gemfile and specify the versions of the gems you want before doing this.

How do I change my Gemfile version?

Process: install the gem generically, looking up your target version on rubygems.org, then update and version your Gemfile. the install command is in the right-hand column. then you can: gem install gem_name -v 1.5.


1 Answers

Version 2.0.2 comes from gem install bundler, but the project uses bundler version 1.12.

To fix your issue run

  1. gem install bundler -v 1.12
  2. bundle _1.12_ install

To start Jekyll run jekyll serve or bundle exec jekyll serve.

like image 136
Christian Avatar answered Oct 19 '22 18:10

Christian