-2

I am doing bundle install on a rails project. But its showing me following error:

Could not find compatible versions

Because rails >= 4.0.0.beta1, < 5.0.5.rc1 depends on bundler
>= 1.3.0, < 2.0
and the current Bundler version (2.4.18) does not satisfy
bundler >= 1.3.0, < 2.0,
  rails >= 4.0.0.beta1, < 5.0.5.rc1 cannot be used.
So, because Gemfile depends on rails = 4.1.6,
  version solving has failed.

Your bundle requires a different version of Bundler than the
one you're running.
Install the necessary version with `gem install
bundler:2.0.0.pre.3` and rerun bundler using `bundle
_2.0.0.pre.3_ update`

I am currently using macOS Monterey (M1) version 12.2.1.

My current rbenv version is 3.1.3

I also tried 'bundle install' but it says:

> An error occurred while installing json (1.8.1),
> and Bundler cannot continue.

I also tried degrading ruby version to 2.1.5 using rbenv install 2.1.5 but it is saying BUILD FAILED (macOS 12.2.1 using ruby-build 20230428)

  • 2
    The error message is pretty clear, you need to downgrade bundler in order to install such an old version of rails. See for example https://stackoverflow.com/questions/9725811/how-to-downgrade-bundler-or-upgrade-rails on how to do that. – Thilo Aug 12 '23 at 12:06
  • What happens when you follow the instructions provided i.e; `gem install bundler:2.0.0.pre.3` then `bundle _2.0.0.pre.3_ update` ? – jamesc Aug 13 '23 at 10:53

0 Answers0