MacOS "Rails is not currently installed on this system."

Firstly, I have installed rails via:

sudo gem install rails

Everything seems to install correctly, but when I type the rails command (rails s, rails -v, etc), I get this error:

Rails is not currently installed on this system. To get the latest version, simply type:
    $ sudo gem install rails
You can then rerun your "rails" command.

The result of which rails is /usr/bin/rails
I tried many different ways that I found on the Internet.
And finally, that works for me:

gem update --system

then,type sudo gem install rails again

Oh yeah

Hope this helps~

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容