Skip to content

bin/brakeman added when running rails app:update even without brakeman in Gemfile #52576

Closed
@etiennebarrie

Description

@etiennebarrie

Steps to reproduce

Upgrading a Rails 7.1 application to Rails 7.2 adds a bin/brakeman when running bin/rails app:update after upgrading the gem.

Expected behavior

Either of these solutions would be acceptable:

  • bin/brakeman is not added unless it's already in the Gemfile.
  • brakeman is added to the Gemfile.

But the first one seems favorable.

Actual behavior

bin/brakeman is added but doesn't work:

$ bin/brakeman 
/Users/etienne/.gem/ruby/3.3.4/gems/bundler-2.5.17/lib/bundler/rubygems_integration.rb:265:in `block in replace_bin_path': can't find executable brakeman for gem brakeman. brakeman is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
	from /Users/etienne/.gem/ruby/3.3.4/gems/bundler-2.5.17/lib/bundler/rubygems_integration.rb:304:in `block in replace_bin_path'
	from bin/brakeman:7:in `<main>'

System configuration

Rails version:
7.1.3.4 then 7.2.0
Ruby version:
3.3.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions