rubymem / bundler-leak

Known-leaky gems verification for bundler: `bundle leak` to check your app and find leaky gems in your Gemfile :gem::droplet:
https://www.rubymem.com
GNU General Public License v3.0
288 stars 11 forks source link

[BUG] 0.3.0 fails with some directory error #50

Closed vassilevsky closed 1 year ago

vassilevsky commented 2 years ago

Branch/Commit:

Release 0.3.0 from rubygems.org

Expected behavior:

It just works :)

Actual behavior:

$ bundler-leak
/usr/local/rbenv/versions/2.5.3-p0/lib/ruby/gems/2.5.0/gems/bundler-leak-0.3.0/lib/bundler/plumber/database.rb:58:in `initialize': "/usr/local/rbenv/versions/2.5.3-p0/lib/ruby/gems/2.5.0/gems/bundler-leak-0.3.0/data/ruby-mem-advisory-db" is not a directory (ArgumentError)
    from /usr/local/rbenv/versions/2.5.3-p0/lib/ruby/gems/2.5.0/gems/bundler-leak-0.3.0/lib/bundler/plumber/scanner.rb:59:in `new'
    from /usr/local/rbenv/versions/2.5.3-p0/lib/ruby/gems/2.5.0/gems/bundler-leak-0.3.0/lib/bundler/plumber/scanner.rb:59:in `initialize'
    from /usr/local/rbenv/versions/2.5.3-p0/lib/ruby/gems/2.5.0/gems/bundler-leak-0.3.0/lib/bundler/plumber/cli.rb:42:in `new'
    from /usr/local/rbenv/versions/2.5.3-p0/lib/ruby/gems/2.5.0/gems/bundler-leak-0.3.0/lib/bundler/plumber/cli.rb:42:in `check'
    from /usr/local/rbenv/versions/2.5.3-p0/lib/ruby/gems/2.5.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
    from /usr/local/rbenv/versions/2.5.3-p0/lib/ruby/gems/2.5.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
    from /usr/local/rbenv/versions/2.5.3-p0/lib/ruby/gems/2.5.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
    from /usr/local/rbenv/versions/2.5.3-p0/lib/ruby/gems/2.5.0/gems/thor-1.2.1/lib/thor/base.rb:[48](https://gitlab.funbox.ru/a2p/vk/beeline-a2p-admin-backend/-/jobs/394127#L48)5:in `start'
    from /usr/local/rbenv/versions/2.5.3-p0/lib/ruby/gems/2.5.0/gems/bundler-leak-0.3.0/exe/bundle-leak:10:in `<top (required)>'
    from /usr/local/rbenv/versions/2.5.3-p0/lib/ruby/gems/2.5.0/gems/bundler-leak-0.3.0/exe/bundler-leak:3:in `load'
    from /usr/local/rbenv/versions/2.5.3-p0/lib/ruby/gems/2.5.0/gems/bundler-leak-0.3.0/exe/bundler-leak:3:in `<top (required)>'
    from /usr/local/rbenv/versions/2.5.3/bin/bundler-leak:23:in `load'
    from /usr/local/rbenv/versions/2.5.3/bin/bundler-leak:23:in `<main>'

Steps to reproduce:

Just run the executable :)

Context and environment:

GitLab CI CentOS 7

I will abide by the [code of conduct] (code_of_conduct.md)

Jigyel1 commented 2 years ago

can you please give me details on how to resolve this issue

ingemar commented 2 years ago

Works fine for me.

❯ gem install bundler-leak
Fetching bundler-leak-0.3.0.gem
Successfully installed bundler-leak-0.3.0
1 gem installed
❯ bundler-leak
No leaks found
MoskitoHero commented 2 years ago

Same issue here on a MacBook Pro M1.

MoskitoHero commented 2 years ago

OK, I think running bundle leak update prior to running bundle leak solves the problem. The README does not make it clear updating the database is a requirement to running bundle leak.

etagwerker commented 1 year ago

Unfortunately I haven't been able to reproduce this issue. If you can provide a sample app that reproduces this or a test scenario, feel free to re-open this issue. Thanks!

damuz91 commented 3 months ago

I could get to reproduce the issue, as mentioned by @MoskitoHero you should first bundle leak update before running bundle leak