I'm using the following gems in a Rails 5.2 app.
# /Gemfile
group :development do
gem 'guard'
gem 'guard-spring'
gem 'guard-rspec'
gem 'brakeman', require: false
gem 'guard-brakeman'
# ...
end
# ...
Brakeman was working fine with Guard, but recently something has changed.
> bundle exec guard
... usual startup trace
------ brakeman warnings --------
00:52:13 - INFO - 6 brakeman findings
00:52:13 - ERROR - Guard::Brakeman failed to achieve its <start>, exception was:
> [#8fe733251410] NoMethodError: undefined method `gsub' for #<Brakeman::FilePath:0x00007f8d0f2c9ea0>
> [#8fe733251410] /Users/me/.rvm/gems/ruby-2.5.3@myapp/gems/guard-brakeman-0.8.3/lib/guard/brakeman.rb:206:in `decorate_warning'
...
00:52:13 - INFO - Guard::Brakeman has just been fired
Looking at the gem repo, there is a comment near the line raising this error
/lib/guard/brakeman.rb
# ...
# line 206
output << " near line #{warning.line}" if warning.line
if warning.file
# fix this ish or wait for brakeman to be fixed
filename = warning.file.gsub(@options[:app_path], '')
# ...
Is anyone else experiencing this issue? Have I configured my app incorrectly and this is preventing Brakeman working with Guard? Or is there an issue in the gem?