Bundler not resolving the right dependencies

Hi everyone! I’m facing an issue on my bundle install step, my Gemfile is as follow

source 'https://rubygems.org'
gemspec

gem 'minitest-ci'

group :development do
  gem 'git-precommit'
  gem 'steep'
  gem 'yard'
end

but my bundle install fail for Ruby 2.2

Bundler can't satisfy your Gemfile's dependencies.
Install missing gems with `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 "ruby":
  In Gemfile:
    ruby

    bundler was resolved to 1.16.1, which depends on
      ruby (>= 1.8.7)

    rake was resolved to 13.0.1, which depends on
      ruby (>= 2.2)

    rubocop (<= 0.82.0) was resolved to 0.68.1, which depends on
      ruby (>= 2.2.2)

    steep was resolved to 0.11.1, which depends on
      ruby (>= 2.5.0)

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

Could not find gem 'steep' in any of the sources.

Exited with code exit status 6
CircleCI received exit code 6

We can see Steep is the culprit here but there are lower versions available that resolves with Ruby 2.2 so my question is: why does Bundler in that case try and fetch version 0.11.1 when it could resolve to 0.1.0.pre?

Thanks in advance!

Hi! You’ve definitely nailed down the issue. What image(s) are you using for your container?

I believe that you need to specify pre and beta versions explicitly in your Gemfile.

source 'https://rubygems.org'
gemspec

gem 'minitest-ci'

group :development do
  gem 'git-precommit'
  gem 'steep', '0.1.0.pre'
  gem 'yard'
end

With that said, that version is set to >= 0 for Ruby compatibility and the next one 0.1.0.pre2 was set for >= 2.4.0. So there is a possibility ‘steep’ is not actually compatible with Ruby 2.2.2, but the original authors did not set the compatibility on that first version. Still might be worth a shot though.