The RVM Best Practices state that, to connect a project to a specific Ruby version, you should specify that version in the project-specific rvmrc file.
This SO answer states that, in most situations, you should use specify the Ruby version in the .ruby-version file.
Heroku says you should specify the Ruby version in Gemfile.
What is the correct way to specify a Ruby version, using RVM, if the app will be deployed on Heroku?
.rvmrc is deprecated and you should use .ruby-version instead.
But Heroku does not pay attention to the .ruby-version. Heroku wants to have it in the Gemfile. So I think you should use both: .ruby-version (for you) and Gemfile (for Heroku).
You need to place it in the Gemfile for Heroku's sake, but if you're using a version manager, then you'll need to use something else for the sake of the version manager. I think the SO answer makes sense in that regard (i.e. the .ruby-version file).
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