I've just updated RVM, and in place of the old .rvmrc
, it auto-created .ruby-gemset
and .ruby-version
.
I've always had .rvmrc
files with contents like rvm use --create default@project_name
. However, .ruby-version
contains the specific Ruby version I'm running rather than default
. I'm hesitant to check this in.
Also, I heard someone say on a podcast that one shouldn't check in .ruby-gemset
because others may have their own preferences about how to name gemsets.
When should or shouldn't I check in .ruby-gemset
and/or .ruby-version
?
Specifically:
Citations from from the creators of tools like rvm, rbenv, etc would be appreciated in an answer.
Ruby on Rails Gems Gemsets A gemset is just a container you can use to keep gems separate from each other. Creating a gemset per project allows you to change gems (and gem versions) for one project without breaking all your other projects.
Ruby version managers (such as chruby) ensure an application uses a specific version of Ruby by looking for a . ruby-version file in the root directory of each app. The file specifies the required version of Ruby for the application and the manager automatically switches the environment to use the specified version.
RVM is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems.
Check in .ruby-version
if your project depends on a ruby like ruby-2.0.0
. Check in .ruby-gemset
only if your team agreed on it. Add .rvmrc
to .gitignore
so anyone can override .ruby-*
files settings with .rvmrc
.
Check in .ruby-version
with ruby-1.8.7
only if your project still targets ruby 1.8.7
, otherwise check it in only if your gem requires it. Do not check in .ruby-gemset
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With