AWS Rails install fails: activesupport requires Ru

2019-06-03 17:15发布

问题:

I am installing rails 5 on aws. I have installed rvm and ruby. Ruby version I installed is 2.3.1. I have done bundle install.

Now I am trying to install rails 5 by using command - 'sudo gem install rails --version 5.0.0'

But I am getting error

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

rvm list

=* ruby-2.3.1 [ x86_64 ]

Complete log on running command - '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.

Why it is showing ruby version required >= 2.2.2 ? What should I do here?

回答1:

Since you are using rvm, you should install gems for the current user. That means without sudo.

gem install rails --version 5.0.0