简体   繁体   中英

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

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

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

如果您不关心拥有较新版本的 Ruby(和rails ),则此特定问题的另一种解决方法,您只需安装最新兼容版本的rails与您的 ruby​​ 版本,类似的示例与需要ruby v2.5.0 sprockets ruby v2.5.0通过安装旧版本的rails v4.1.16查看依赖关系图解决

sudo gem install rails -v 4.1.16

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM