Linguist: Bundler could not find compatible versions for gem "bundler"

Created on 7 Jun 2020  路  2Comments  路  Source: github/linguist

Preliminary Steps

Please confirm you have...

Problem Description

I'm trying to follow the CONTIBUTING.md documentation but I'm stuck on some strange error.

Even if I run gem install bundler -v "~>1.10" (and Ruby installs Bundler 1.17.3), I get this error message when I try to do script/bootstrap:

Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    bundler (~> 1.10)

  Current Bundler version:
    bundler (2.1.4)
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.10)' in any of the relevant sources:
  the local ruby installation

I'm using Ubuntu 20.04 LTS on Windows Subsystem for Linux (WSL).

I have tried:

  • Reinstalling Ubuntu on WSL;
  • Uninstalling Bundler 2.1.4 (no success, Ruby says it's a "default gem");
  • Updating and upgrading packages;
  • Changing the Bundler required version on Gemfile (which as I expected, brought lots of other problems).

I'm not very familiar with Linux, so, sorry if it's a dumb issue. What am I missing here?

Most helpful comment

That worked at some level but then I got this error:

An error occurred while installing charlock_holmes (0.7.7), and Bundler cannot continue. Make sure that gem install charlock_holmes -v '0.7.7' --source 'https://rubygems.org/' succeeds before bundling.

I tried to run the suggested command: gem install charlock_holmes -v '0.7.7' --source 'https://rubygems.org/'

But then I got:

ERROR: Error installing charlock_holmes: ERROR: Failed to build gem native extension.

Ruby-dev and make are also installed and updated:
ruby-dev is already the newest version (1:2.7+1).
make is already the newest version (4.2.1-1.2).

It seems that g++ isn't installed. If I can get this to work, I'll give feedback. Thanks!

Edit: After installing g++ and charlock_holmes successfully, I was able to run script/bootstrap. Thanks again, @lildude!

All 2 comments

This should do the trick:

  • remove the Gemfile.lock file if it exists in the linguist directory
  • install Bundler 1.17.3: gem install bundler -v 1.17.3
  • run bundler _1.17.3_
  • pick up the steps in CONTRIBUTING.md with script/bootstrap

That worked at some level but then I got this error:

An error occurred while installing charlock_holmes (0.7.7), and Bundler cannot continue. Make sure that gem install charlock_holmes -v '0.7.7' --source 'https://rubygems.org/' succeeds before bundling.

I tried to run the suggested command: gem install charlock_holmes -v '0.7.7' --source 'https://rubygems.org/'

But then I got:

ERROR: Error installing charlock_holmes: ERROR: Failed to build gem native extension.

Ruby-dev and make are also installed and updated:
ruby-dev is already the newest version (1:2.7+1).
make is already the newest version (4.2.1-1.2).

It seems that g++ isn't installed. If I can get this to work, I'll give feedback. Thanks!

Edit: After installing g++ and charlock_holmes successfully, I was able to run script/bootstrap. Thanks again, @lildude!

Was this page helpful?
0 / 5 - 0 ratings