William Hu
William Hu

Reputation: 16141

Can't update to rails 5 because of ruby version

I am planning to run ruby 2.3.1 version with Rails 5 on Mac OSX.

1 I installed rbenv then install ruby version 2.3.1.

rbenv version
2.3.1 (set by /D/testProject/.ruby-version)

2 Update gem

gem update --system
Latest version currently installed. Aborting.

3 System ruby version:

ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]

But when i run gem update rails, i got

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

So my question is how to make the gem update rails according to rbenv ruby version, not system version? Then i can update to Rails 5.

or

Do i have to update my system version of ruby to update to Rails5.

EDIT

I have ran rbenv local 2.3.1 (.ruby-version was created) already. But still can't update to Rails5 Thank you!

EDIT

which ruby
/usr/bin/ruby

Upvotes: 0

Views: 1682

Answers (3)

Keon Cummings
Keon Cummings

Reputation: 1811

Assuming you have already updated ruby using something like

sudo gem update --system

You can then set the rvm gemset lst to use the global version(s) installed.

 rvm gemset list

 rvm gemset use global -save

Upvotes: 0

William Hu
William Hu

Reputation: 16141

I update my system version of ruby solved the issue.

brew install ruby

Upvotes: 2

siegy22
siegy22

Reputation: 4413

you can use this command:

$ rbenv local 2.2.2

(this will generate a .ruby-version file)

Upvotes: 0

Related Questions