vidal
vidal

Reputation: 345

AWS Rails install fails: activesupport requires Ruby version >= 2.2.2

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?

Upvotes: 1

Views: 3278

Answers (2)

Krishna Parmar
Krishna Parmar

Reputation: 1

This worked for me when I updated my Ruby version to the latest 3.2.2, the latest available (presently). Use "rbenv install --l" to check for the latest version.

brew install rbenv ruby-build rbenv init eval "$(rbenv init - zsh)" rbenv install --l rbenv install 3.2.2 rbenv global 3.2.2

Upvotes: 0

Sergey Kovalev
Sergey Kovalev

Reputation: 9401

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

gem install rails --version 5.0.0

Upvotes: 4

Related Questions