0

I'm trying to run the command bundle install and getting the following error -

Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    blog_posts was resolved to 0.0.1, which depends on
      blog_viewers was resolved to 0.0.1, which depends on
        rails (~> 4.2) was resolved to 4.2.7, which depends on
          bundler (< 2.0, >= 1.3.0)

  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 (< 2.0, >= 1.3.0)', which is required by gem 'rails (~> 4.2)', in any of the sources.

If I downgrade the version then I'm getting the following error -

Traceback (most recent call last):
        1: from /home/user/.rbenv/versions/2.6.6/bin/bundle:23:in `<main>'
/home/user/.rbenv/versions/2.6.6/bin/bundle:23:in `load': cannot load such file -- /home/user/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/exe/bundle (LoadError)

NOTE - The default bundler version is 1.17.3

Is there any way to resolve this issue? Any kind of help would be greatly appreciated.

Dynamo
  • 67
  • 11
  • Does this answer your question? [How to downgrade bundler or upgrade rails?](https://stackoverflow.com/questions/9725811/how-to-downgrade-bundler-or-upgrade-rails) – Cassandra S. Jan 05 '21 at 11:18
  • @CassandraS. No, it doesn't answer my question. – Dynamo Jan 05 '21 at 11:43
  • It's the exact same error, though, even if the question title is different. – Cassandra S. Jan 05 '21 at 12:17
  • In my case firstly I don't want to upgrade the rails and secondly after downgrading the bundler version it is showing the other error. – Dynamo Jan 05 '21 at 12:30
  • 1
    Possible to share your Gemfile? I am interested to know what the `blog_posts` and `blog_viewers` are – Anuj Jan 05 '21 at 12:54

1 Answers1

0

Try gem install bundler and again bundle install

Juanse Gimenez
  • 481
  • 4
  • 14