Skip to content

Commit

Permalink
Don't require debug
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mike-burns committed Dec 29, 2023
1 parent 2b9e3a4 commit 7dcb9af
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit 7dcb9af

Please sign in to comment.