-
Notifications
You must be signed in to change notification settings - Fork 105
Use .ruby-version file #458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This is pretty much the community standard now, and is supported by all the major version managers (rbenv, rvm, chruby, etc.) and tooling (Rubocop, the `ruby/setup-ruby@v1` GitHub action, etc.)
@@ -8,7 +8,7 @@ | |||
set :deploy_to, '/home/apps/t4c' | |||
|
|||
set :rvm_type, :user | |||
set :rvm_ruby_version, '3.2.6' | |||
set :rvm_ruby_version, File.read("#{File.dirname(__FILE__)}/../.ruby-version").strip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This style recommended/documented here: https://github.com/capistrano/rbenv?tab=readme-ov-file#usage
@@ -6,7 +6,6 @@ require: | |||
- rubocop-rspec | |||
|
|||
AllCops: | |||
TargetRubyVersion: 3.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.rubocop.org/rubocop/configuration.html#setting-the-target-ruby-version
If a
TargetRubyVersion
is not specified in your config, then RuboCop will check your project for a series of other files where the Ruby version may be specified already. The files that will be checked are (in this order):*.gemspec
,.ruby-version
,.tool-versions
, andGemfile.lock
.
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby-version }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/ruby/setup-ruby?tab=readme-ov-file#single-job
Not needed with a
.ruby-version
This is pretty much the community standard now, and is supported by all the major version managers (rbenv, rvm, chruby, etc.) and tooling (Rubocop, the
ruby/setup-ruby@v1
GitHub action, etc.)Makes it a little more seamless to get up and running to make contributions.