I just followed this RailsApps install/setup tutorial, which uses RVM and creates a .ruby-version and a .ruby-gemset to specify the Ruby version and a project-specific gemset.
I already read this post regarding on what to do to these files for version control.
My question is how about when deploying to hosting platforms, like Heroku? They point to your git repository which may or may not include these files. Is it still OK to check-in .ruby-version when deploying?
For example, the Heroku docs says the the Ruby version is specified via Gemfile or environment variable. So I'm a little confused if platforms like Heroku respect these RVM-generated files.
Notes:
Per the docs Heroku will look for your Ruby version in a few places: 1) Gemfile 2) An environment variable called CUSTOM_RUBY_VERSION
I prefer to specify the Ruby version in my Gemfile.
So, Heroku should ignore .ruby-version. The Ruby you specify in your Gemfile should probably match the version specified in .ruby-version
As a general rule I would check .ruby-version into source control.
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