This commit fixes an error that would occur at both post-install and
runtime if the frontmost Ruby in the `PATH` is not Homebrew’s Ruby:
```
/usr/local/Cellar/wpscan/2.9.4/libexec/gems/bundler-1.16.4/lib/bundler/spec_set.rb:91:in `block in materialize': Could not find ffi-1.9.25 in any of the sources (Bundler::GemNotFound)
from /usr/local/Cellar/wpscan/2.9.4/libexec/gems/bundler-1.16.4/lib/bundler/spec_set.rb:85:in `map!'
from /usr/local/Cellar/wpscan/2.9.4/libexec/gems/bundler-1.16.4/lib/bundler/spec_set.rb:85:in `materialize'
[…]
/usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `write': Broken pipe (Errno::EPIPE)
from /usr/local/Homebrew/Library/Homebrew/utils/fork.rb:49:in `puts'
[…]
from /usr/local/Homebrew/Library/Homebrew/brew.rb:89:in `<main>'
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall wpscan`
```
The error is in the shim script. It executes `bundle exec ruby`,
which causes Bundler to use the frontmost Ruby in the `PATH`,
expecting vendored gems to fit that Ruby version.
Because the formula `depends_on "ruby"`, vendored gems are pinned to
the version of the Homebrew-installed Ruby at install time. If the
Homebrew-installed Ruby is not identical to the frontmost Ruby in the
`PATH`, any invocation of `wpscan` will fail, including the one in
`post_install`. The same happens if a Ruby version manager like
`rbenv` is installed.
The fix is to modify the shim script so it always uses the
Homebrew-installed Ruby.
Closes#31836.
Signed-off-by: FX Coudert <fxcoudert@gmail.com>