I'm setting up a new machine and trying to install Ruby with chruby. I used ruby-install to install both ruby 2.3 and 2.1.2 because that's what everybody else on my team is running.
When I run chruby
I get:
ruby-2.1.2 ruby-2.3.0
Then I run:
chruby ruby-2.1.2
and:
$ chruby
* ruby-2.1.2
ruby-2.3.0
$ ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin14.0]
The problem is that when I close terminal and open it again the default Ruby version goes back to ruby-2.3.0. How can I set a default version with chruby?
chruby
stub isn't getting activated properly when you create a shell. Are you sure it installed successfully? – Fluororvm
andrbenv
, but they all work on the same principle. The installation instructions includes a step where you have to add a line to~/.bashrc
. Did you do that? It's easy to miss. – Fluoro.ruby-version
file is to set the version for a user or a project. It's not strictly necessary but can be useful. If absent should go to the global default, if there is one. – Fluorowhich ruby
as to the one you're using, and look atecho $PATH
to see that thechruby
stuff is in there properly. – Fluoro