AWS Rails安装失败:activesupport需要Ruby版本> = 2.2.2

时间:2016-12-11 11:15:19

标签: ruby-on-rails amazon-web-services amazon-ec2 ruby-on-rails-5 ami

我在aws上安装rails 5。我已经安装了rvm和ruby。我安装的Ruby版本是2.3.1。我已完成捆绑安装。

现在我尝试使用命令安装rails 5 - 'sudo gem install rails --version 5.0.0'

但我收到错误

ERROR:  Error installing rails:
        activesupport requires Ruby version >= 2.2.2.

rvm list

=* ruby-2.3.1 [ x86_64 ]

完成登录运行命令 - 'sudo gem install rails --version 5.0.0'

Fetching: i18n-0.7.0.gem (100%)
Successfully installed i18n-0.7.0
Fetching: thread_safe-0.3.5.gem (100%)
Successfully installed thread_safe-0.3.5
Fetching: tzinfo-1.2.2.gem (100%)
Successfully installed tzinfo-1.2.2
Fetching: minitest-5.10.1.gem (100%)
Successfully installed minitest-5.10.1
Fetching: concurrent-ruby-1.0.2.gem (100%)
Successfully installed concurrent-ruby-1.0.2
Fetching: activesupport-5.0.0.gem (100%)
ERROR:  Error installing rails:
        activesupport requires Ruby version >= 2.2.2.

为什么显示所需的ruby版本> = 2.2.2?我该怎么办?

1 个答案:

答案 0 :(得分:4)

由于您使用的是rvm,因此您应该为当前用户安装gem。这意味着没有 sudo

gem install rails --version 5.0.0