How to find out what Ruby version a project has used + Github

Viewed 581

I cloned one of my 3years old project from Github to resurrect, however I'm getting bunch of migrations, gem, etc errors. Googling gives me tips about possibly using wrong ruby version.

I want to assign the specific rbenv local rubyver but I don't know which one I used and I can't find it in any settings?

Any idea how I can find what Ruby version is this project using?

1 Answers

There's a few places this might be annotated:

  1. A .ruby-version file, though these are often ignored to avoid friction between developers with slightly different versions. This is what rbenv uses, as well as other tools like RVM.
  2. The Gemfile can have a ruby version lock in it, though this is usually a minimum requirement, like >= 2.3.0.
  3. The README if the developer is kind.

Otherwise, there's no real way to know.

It's worth noting that Ruby 2.0, 2.4 and 3.0 are often the biggest upgrade hurdles, so it's worth trying with the latest version you can get away with, like 2.7.2 if practical, 3.0.0 if possible.

Related