Clay Bridges
Clay Bridges

Reputation: 11880

Specify project ruby version independent of whether I use `rvm` or `rbenv`?

Not wanting to commit to e.g. .rvmrc for specifying the ruby version.

Upvotes: 0

Views: 41

Answers (2)

Clay Bridges
Clay Bridges

Reputation: 11880

In the top-level directory of your project, create a file named .ruby-version containing only the version of ruby you want to use, e.g.

2.1.0

You can sometimes also specify system (known example: MacOS).

Upvotes: 1

Martin
Martin

Reputation: 7714

If your project is using a Gemfile you can set it there too:

ruby '1.9.3'

This is of course 'per project' and not global. Heroku uses it that way.

Upvotes: 1

Related Questions