Reputation: 136
I am trying to upgrade Ruby because I need to setup a Jekyll template, and I need to latest version to do it. Since I have a Mac running Sierra, I already have Ruby preinstalled as well as the Homebrew installation. When I install it using brew install ruby
, it works, but when I check the version, it is still at 2.0.0 instead of 2.3.1 where it should be. Homebrew says I have 2.3.1, but the CLI says I have 2.0.0. I tried to use brew link --override ruby
to make it work, but it said everything was working and it got me nowhere.
Upvotes: 1
Views: 402
Reputation: 1501
Use rbenv and plugin ruby-build. It will keep several versions of ruby on the one machine.
After install go to directory with your code, run rbenv install 2.3.1
and create file .ruby-version
containing 2.3.1
. All scripts running from this directory will use ruby 2.3.1.
Or you will able to set ruby version for all running scripts - rbenv global 2.3.1
Upvotes: 2