Skip to content

Commit

Permalink
Be clear about supported Rails and Ruby versions
Browse files Browse the repository at this point in the history
[Ruby 2.7 and older] is end of life.

[Rails 6.0 and older] is end of life.

Rails 6 [requires] Ruby >= 2.5, Rails 7 requires Ruby >= 2.7.

[Ruby 2.7 and older]: https://www.ruby-lang.org/en/downloads/branches/
[Rails 6.0 and older]: https://guides.rubyonrails.org/maintenance_policy.html
[requires]: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#ruby-versions

---

Don't require debug. This isn't needed for tests. But moreover, it
causes an error on Ruby 3.0.

It opens with:

``ruby
if $SAFE > 0
  STDERR.print "-r debug.rb is not available in safe mode\n"
  exit 1
end
```

But `$SAFE` is not set, so we get `nil > 0`, and an error.

```
% ruby -rdebug -e 'puts "OK"'
/home/mike/.rubies/ruby-3.0.6/lib/ruby/3.0.0/debug.rb:9:in `<top (required)>': undefined method `>' for nil:NilClass (NoMethodError)
        from <internal:/home/mike/.rubies/ruby-3.0.6/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/home/mike/.rubies/ruby-3.0.6/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
```

This is not an issue on Ruby 3.1.

---

Ruby 3.1 + Rails 7.1 leads to an issue around the `error_highlight`
library. Rather than debug that, we can skip that combination and hope
for the best.
  • Loading branch information
mike-burns committed Dec 29, 2023
1 parent db1aae5 commit 499635f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 62 deletions.
20 changes: 4 additions & 16 deletions .github/workflows/build.yml
Expand Up @@ -10,22 +10,10 @@ jobs:
fail-fast: false
matrix:
rails: ["7.1", "7.0", "6.1"]
ruby: ["3.2", "3.1"]
include:
- rails: "6.1"
ruby: "3.0"
- rails: "6.1"
ruby: "2.7"
- rails: "6.0"
ruby: "2.7"
- rails: "5.2"
ruby: "2.7"
- rails: "5.2"
ruby: "2.6"
- rails: "5.1"
ruby: "2.6"
- rails: "5.0"
ruby: "2.5"
ruby: ["3.2", "3.1", "3.0"]
exclude:
- ruby: "3.1"
rails: "7.1"

runs-on: 'ubuntu-latest'

Expand Down
42 changes: 0 additions & 42 deletions Appraisals
@@ -1,44 +1,3 @@
# These are the versions of Rails we want to test against.
appraise "rails5.0" do
gem "byebug"
gem "listen", "~> 3.0.5"
gem "puma", "~> 3.0"
gem "rails", "~> 5.0.7", ">= 5.0.7.2"
gem "spring", "!= 2.1.1"
gem "spring-watcher-listen", "~> 2.0.0"
gem "sqlite3", "~> 1.3.6"
end

appraise "rails5.1" do
gem "byebug"
gem "listen", ">= 3.0.5", "< 3.2"
gem "puma", "~> 3.7"
gem "rails", "~> 5.1.7"
gem "spring", "!= 2.1.1"
gem "spring-watcher-listen", "~> 2.0.0"
gem "sqlite3", "~> 1.3.6"
end

appraise "rails5.2" do
gem "byebug"
gem "listen", ">= 3.0.5", "< 3.2"
gem "puma", "~> 3.11"
gem "rails", "~> 5.2.4", ">= 5.2.4.2"
gem "spring", "!= 2.1.1"
gem "spring-watcher-listen", "~> 2.0.0"
gem "sqlite3", "~> 1.3.6"
end

appraise "rails6.0" do
gem "byebug"
gem "listen", "~> 3.2"
gem "puma", "~> 4.1"
gem "rails", "~> 6.0.2", ">= 6.0.2.2"
gem "spring", "!= 2.1.1"
gem "spring-watcher-listen", "~> 2.0.0"
gem "sqlite3", "~> 1.4"
end

appraise "rails6.1" do
gem "byebug"
gem "listen", "~> 3.2"
Expand All @@ -61,7 +20,6 @@ end

appraise "rails7.1" do
gem "byebug"
gem "error_highlight", ">= 0.4.0"
gem "listen", "~> 3.2"
gem "puma", "~> 6.0"
gem "rails", "~> 7.1.0"
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
factory_bot_rails (6.4.0)
factory_bot_rails (6.4.2)
factory_bot (~> 6.4)
railties (>= 5.0.0)

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -7,7 +7,7 @@ Bundler::GemHelper.install_tasks name: "factory_bot_rails"

Cucumber::Rake::Task.new(:cucumber) do |t|
t.fork = true
t.cucumber_opts = ["--format", (ENV["CUCUMBER_FORMAT"] || "progress")]
t.cucumber_opts = ["--format", ENV.fetch("CUCUMBER_FORMAT", "progress")]
end

RSpec::Core::RakeTask.new(:spec)
Expand Down
3 changes: 2 additions & 1 deletion features/support/rails_template
Expand Up @@ -2,7 +2,8 @@ if Rails.gem_version < Gem::Version.new('6')
gsub_file "Gemfile", /^gem 'sqlite3'$/, 'gem "sqlite3", "~> 1.3.6"'
end

gsub_file "Gemfile", /^ gem 'spring'$/, ' gem "spring", "!= 2.1.1"'
gsub_file "Gemfile", /^ gem 'spring'$/, ' gem "spring", "!= 2.1.1"'
gsub_file "Gemfile", /^ gem "debug".*/, ''

if Rails.gem_version >= Gem::Version.new('7.1')
append_to_file File.join("config", "application.rb"), <<~RUBY
Expand Down
1 change: 0 additions & 1 deletion gemfiles/rails7.1.gemfile
Expand Up @@ -5,7 +5,6 @@ source "https://rubygems.org"
gem "appraisal"
gem "aruba"
gem "cucumber"
gem "error_highlight", ">= 0.4.0"
gem "rake"
gem "rspec-rails"
gem "standard"
Expand Down

0 comments on commit 499635f

Please sign in to comment.