Projjol
Projjol

Reputation: 1375

Need to set ruby version each time a terminal session is started

I use rvm on my Ubuntu 14.04 machine and each time I start the terminal, the ruby version selected (from ruby -v) is ruby 1.9.3p551 . rvm --default use 2.2.3 lets me use the selected ruby version, but the entire process needs to be redone each time a new session is started.

How can this be resolved?

Upvotes: 0

Views: 234

Answers (2)

Roman Kiselenko
Roman Kiselenko

Reputation: 44370

You can use the .ruby-version file. This file checked by both ruby version managers, like rvm and rbenv.

For example you can place a file .ruby-version with 2.2.3 in the home directory ~/.ruby-version, it is should set the ruby version at 2.2.3 for any new terminal session. Also you can place a file .ruby-version in the project directory, /path/to/the/project/.ruby-version it is should set ruby version for project.

Upvotes: 0

Laurens
Laurens

Reputation: 2420

Check in your gemfile if there is a references to 1.9.3

If not, check this answer and follow the instructions How to set default Ruby version with RVM?

Upvotes: 1

Related Questions