Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bundle install error - ruby_dep-1.5.0 requires ruby version >= 2.2.5 but I have version 3.0.1p64

I used to work in a project with a Ubuntu machine flawlessly. After some time, I decided to hop into Fedora and now that I've setup everything, I was going to continue the project but when I run bundle install I get the following:

➜ bundle install
Following files may not be writable, so sudo is needed:
  /usr/bin
  /usr/share/gems
  /usr/share/gems/build_info
  /usr/share/gems/bundler
  /usr/share/gems/cache
  /usr/share/gems/doc
  /usr/share/gems/extensions
  /usr/share/gems/gems
  /usr/share/gems/plugins
  /usr/share/gems/specifications
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies....
ruby_dep-1.5.0 requires ruby version >= 2.2.5, ~> 2.2, which is incompatible with the current version, ruby 3.0.1p64

Clearly my Ruby version requirement is met. Should I downgrade it so I could continue? If so, how to properly do it without rvm or rbenv?

I was able to find 2 lines with ruby_dep on Gemfile.lock and I'm not quite sure how to proceed. The first result is nested and the other isn't:

listen (3.1.5)
  rb-fsevent (~> 0.9, >= 0.9.4)
  rb-inotify (~> 0.9, >= 0.9.7)
  ruby_dep (~> 1.2)
...
ruby_dep (1.5.0)

Should I keep one or change the version of both? I couldn't find ruby_dep anywhere else besides Gemfile.lock

like image 590
Felipe Avatar asked Jul 02 '21 04:07

Felipe


2 Answers

I ran into the same issue.

One method is to delete your Gemfile.lock and run bundle install

This deletes all existing references to ruby_dep and gives you a fresh install of your gems.

like image 170
Richard Kuo Avatar answered Sep 20 '22 00:09

Richard Kuo


Deleting the whole Gemfile.lock file (as suggested in another answer) might not be the best idea.

First, simply try to update the ruby_dep in your dependencies:

bundle update ruby_dep
like image 27
Jacka Avatar answered Sep 22 '22 00:09

Jacka