Skip to content

Conversation

@mattbrictson
Copy link
Member

@mattbrictson mattbrictson commented Jan 12, 2025

Already, the latest version of the sshkit gem is no longer installable on Ruby 2.2 or older. See #548.

Rather than add workarounds to the sshkit code to restore compatibility with old versions of Ruby, we've decided to officially drop support for them.

This PR drops support for Ruby 2.0, 2.1, 2.2, 2.3, and 2.4. For reference, Ruby 2.4 was officially EOL'd 4 years and 9 months ago (31 Mar 2020), so it is not unreasonable for us to drop support in 2025.

If users wish to use the sshkit gem on an old version of Ruby, they can still do so by installing an older version. For example, 1.22.0 works on Ruby 2.2.

gem install sshkit -v 1.22.0

@mattbrictson mattbrictson added the ⚠️ Breaking Introduces a backwards-incompatible change label Jan 12, 2025
strategy:
matrix:
ruby: ["2.0", "ruby"]
ruby: ["2.5", "ruby"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ Run slow functional tests on the oldest Ruby we support (2.5) and the latest Ruby.

Style/DoubleNegation:
Enabled: false
Style/FileName:
Naming/FileName:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ I had to upgrade the rubocop gem to support TargetRubyVersion: 2.5. The new version migrated the names of some cops, hence the changes in these configs.

gemspec

# public_suffix 3+ requires ruby 2.1+
if Gem::Requirement.new('< 2.1').satisfied_by?(Gem::Version.new(RUBY_VERSION))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ No longer needed, since we no longer support Ruby < 2.1.

@@ -1,5 +1,4 @@
require "monitor"
require "thread"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ RuboCop flagged this as an unnecessary require (the Thread constant is always available without needing to require it.)

def test_test_does_not_raise_on_non_zero_exit_status
Netssh.new(a_host) do |_host|
test :false
test :false # rubocop:disable Lint/BooleanSymbol
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗒️ RuboCop thinks this is a typo, and that we mean false and not :false. However in this case :false is the name of a command we are executing via SSH, not a boolean value.

@mattbrictson mattbrictson marked this pull request as ready for review January 12, 2025 23:26
@mattbrictson mattbrictson merged commit 02da5e2 into master Jan 30, 2025
15 checks passed
@mattbrictson mattbrictson deleted the drop-old-rubies branch January 30, 2025 05:21
mattbrictson added a commit to mattbrictson/airbrussh that referenced this pull request Nov 28, 2025
This PR drops support for support for Ruby 1.9, 2.0, 2.1, 2.2, 2.3, and
2.4. This aligns us with SSHKit, which already dropped support for Ruby
< 2.5 earlier this year: capistrano/sshkit#549.

If you are still using one of these old versions of Ruby and would like
to use Airbrussh, you can explicitly install an older version like this:

```
gem install airbrussh --version 1.5.3
```
mattbrictson added a commit to capistrano/capistrano that referenced this pull request Nov 29, 2025
This PR drops support for Ruby < 2.5 for the following reasons:

1. These versions of Ruby have been EOL for over 5 years.
2. SSHKit (which Capistrano depends on) dropped support for Ruby < 2.5
earlier this year: <capistrano/sshkit#549>.
3. GitHub recently removed the `ubuntu-20.04` runner, which means we can
no longer test old versions of Ruby in CI.

For users that want to use Capistrano with an old version of Ruby, they
can explicitly install a compatible version like this:

```
gem install capistrano --version 3.19.2
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ Breaking Introduces a backwards-incompatible change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants