Felipe
Felipe

Reputation: 381

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

Upvotes: 22

Views: 11242

Answers (5)

Full Array
Full Array

Reputation: 807

Step-by-step

  1. Add webrick gem to gemfile

  2. Remove specific jekyll version number from gemfile. Leave only gem "jekyll"

  3. Run bundler

  4. Run bundle exec jekyll serve --livereload

Upvotes: 0

Kaka Ruto
Kaka Ruto

Reputation: 5125

When it says it requires sudo to install gems, it's because you're using the system Ruby (Ruby that your OS uses), and it's not a good idea to alter that.

Install a different version of Ruby and confirm it's set to that, then bundle.

Upvotes: 0

Jacka
Jacka

Reputation: 2560

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

Upvotes: 14

Richard Kuo
Richard Kuo

Reputation: 838

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.

Upvotes: 31

Nik
Nik

Reputation: 125

Pay attention to ~> 2.2, it means 2.x, but not 3. Read more here https://bundler.io/gemfile.html

Upvotes: -3

Related Questions