10

I recently changed my laptop and tried installing rails with

gem install rails

and I got this error

ERROR:  Error installing rails:
    zeitwerk requires Ruby version >= 2.4.4.

I have installed ruby version 2.4.4, 2.5.7, and 2.6.5 and I'm still getting the same error. Any pointers how to resolve this will be greatly appreciated. thanks

Ayogu Chibueze
  • 211
  • 1
  • 4
  • 10

2 Answers2

2

In directory wanted use rvm use ruby-2.5.7 command line to force the usage of this specific version of ruby and after gem install rails. Just tryed minutes ago and works fine

fl0_9
  • 261
  • 3
  • 12
1

Another workaround for this specific issue if you don't care about having a newer version of Ruby (and rails), you can just install the most recent compatible version of rails with your version of ruby, a similar example with sprockets which requires ruby v2.5.0 solved by installing an older version of rails v4.1.16 looking at the dependencies graph:

sudo gem install rails -v 4.1.16
Ibrahim.H
  • 1,062
  • 1
  • 13
  • 22