I wanted to learn programming and tried to install Ruby on Rails on my Mac.
For Ruby, upgrade from what was in the beginning, and the result ofruby ​​-vis
ruby ​​2.6.4p104 (2019-08-28 revision 67798) [x86_64-darwin18]
It becomes.
And thensudo gem install rails, although it is 2.6.4,
For some reason, it must be at least 2.4.4, so it has failed and I am in trouble.

Error message
ERROR: Error installing rails:
    zeitwerk requires Ruby version>= 2.4.4.
Applicable source code
sudo gem install rails

I tried a lot, but I haven't found anything like this for now. . .

Supplemental information (FW/tool version etc.)

When the first attempt fails
HEADS UP!error, i18n error (I forgot details),
Unnecessarily it disappears and is an error like the one above.

  • Answer # 1

    There is a possibility that the ruby ​​and gem are different versions.
    I heard that you have raised the ruby ​​version. Is it rbenv? Is it a plain installation?

    which ruby ​​
    which gem

    Please compare paths

  • Answer # 2

    What is the Rails version?
    No other version
    How to install Ruby on Rails (Mac, Window) (latest Ruby2.5/Rails5.2 [2018 edition])
    Try it?

  • Answer # 3

    The Ruby version of the system may be old. How many versions do you get withsudo ruby ​​-v?

  • Answer # 4

    ruby ​​(also 2.6.4) doesn't change if you reinstallrbenv installinstead ofbrew install, but from thererbenv global 2.6.4and then try again, it worked fine.
    Will it be a story like PATH is not good?
    I don't understand the reason well, but I would like to examine it if there is another opportunity.
    Thank you very much for solving this issue.