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
289 stars 11 forks source link

`bundle exec rake` does not work after setting up dev environment #22

Closed etagwerker closed 5 years ago

etagwerker commented 5 years ago

When I clone the project and I run ./bin/setup, I get this error:

$ ./bin/setup
Using rake 12.3.3
Using bundler 2.0.1
Using thor 0.20.3
Using bundler-leak 0.1.0 from source at `.`
Using byebug 11.0.1
Using diff-lcs 1.3
Using docile 1.3.2
Using json 2.2.0
Using kramdown 0.14.2
Using rspec-support 3.8.2
Using rspec-core 3.8.2
Using rspec-expectations 3.8.4
Using rspec-mocks 3.8.1
Using rspec 3.8.0
Using rubygems-tasks 0.2.4
Using simplecov-html 0.10.2
Using simplecov 0.17.0
Using yard 0.9.20
Bundle complete! 8 Gemfile dependencies, 18 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

[!] There was an error parsing `Gemfile`: No such file or directory @ rb_sysopen - /Users/etagwerker/Projects/fastruby/bundler-leak/spec/bundle/insecure_sources/Gemfile. Bundler cannot continue.

[!] There was an error parsing `Gemfile`: No such file or directory @ rb_sysopen - /Users/etagwerker/Projects/fastruby/bundler-leak/spec/bundle/secure/Gemfile. Bundler cannot continue.
Using rake 12.3.3
Using concurrent-ruby 1.1.5
Using i18n 1.6.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using zeitwerk 2.1.9
Using activesupport 6.0.0
Using builder 3.2.3
Using erubi 1.8.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.4
Using rails-dom-testing 2.0.3
Using crass 1.0.4
Using loofah 2.2.3
Using rails-html-sanitizer 1.2.0
Using actionview 6.0.0
Using rack 2.0.7
Using rack-test 1.1.0
Using actionpack 6.0.0
Using bundler 2.0.1
Using dotenv 2.7.5
Using nenv 0.3.0
Using rspec-logsplit 0.1.3
Using hitimes 1.3.1
Using timers 4.0.4
Using celluloid-essentials 0.20.2
Using celluloid-extras 0.20.0
Using celluloid-fsm 0.20.0
Using celluloid-pool 0.20.0
Using celluloid-supervision 0.20.1
Using celluloid 0.17.0
Using method_source 0.9.2
Using thor 0.20.3
Using railties 6.0.0
Using jquery-rails 4.3.5
Using libv8 3.16.14.19 (x86_64-darwin-17)
Using ref 2.0.0
Using sqlite3 1.4.1
Using therubyracer 0.12.1
Bundle complete! 4 Gemfile dependencies, 40 gems now installed.
Bundled gems are installed into `./vendor/bundle`

Maybe the script is missing a few steps?

bronzdoc commented 5 years ago

@etagwerker did you mean to open this issue in https://github.com/ombulabs/rubymem.com ?

etagwerker commented 5 years ago

@bronzdoc My bad, I just updated the issue. I'm trying to do a basic git clone + bundle exec rake and it is not working :(

etagwerker commented 5 years ago

@bronzdoc I'm still getting failures when I do a clean install + ./bin/setup (using #23)

Failures:

  1) CLI when auditing a bundle with unpatched gems should print a warning
     Failure/Error: expect(subject).to include("Leaks found!")

       expected "/Users/etagwerker/Projects/rubymem/bundler-leak/lib/bundler/plumber/scanner.rb:61:in `read': No such...:in `load'\n\tfrom /Users/etagwerker/Projects/rubymem/bundler-leak/bin/bundler-leak:3:in `<main>'\n" to include "Leaks found!"
       Diff:
       @@ -1,2 +1,12 @@
       -Leaks found!
       +/Users/etagwerker/Projects/rubymem/bundler-leak/lib/bundler/plumber/scanner.rb:61:in `read': No such file or directory @ rb_sysopen - /Users/etagwerker/Projects/rubymem/bundler-leak/spec/bundle/unpatched_gems/Gemfile.lock (Errno::ENOENT)
       +    from /Users/etagwerker/Projects/rubymem/bundler-leak/lib/bundler/plumber/scanner.rb:61:in `initialize'
       +    from /Users/etagwerker/Projects/rubymem/bundler-leak/lib/bundler/plumber/cli.rb:41:in `new'
       +    from /Users/etagwerker/Projects/rubymem/bundler-leak/lib/bundler/plumber/cli.rb:41:in `check'
       +    from /Users/etagwerker/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
       +    from /Users/etagwerker/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
       +    from /Users/etagwerker/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
       +    from /Users/etagwerker/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
       +    from /Users/etagwerker/Projects/rubymem/bundler-leak/bin/bundle-leak:10:in `<top (required)>'
       +    from /Users/etagwerker/Projects/rubymem/bundler-leak/bin/bundler-leak:3:in `load'
       +    from /Users/etagwerker/Projects/rubymem/bundler-leak/bin/bundler-leak:3:in `<main>'

     # ./spec/integration_spec.rb:19:in `block (3 levels) in <top (required)>'

  2) CLI when auditing a bundle with unpatched gems should print advisory information for the leaky gems
     Failure/Error: expect(subject).to match(advisory_pattern)

       expected "/Users/etagwerker/Projects/rubymem/bundler-leak/lib/bundler/plumber/scanner.rb:61:in `read': No such...:in `load'\n\tfrom /Users/etagwerker/Projects/rubymem/bundler-leak/bin/bundler-leak:3:in `<main>'\n" to match /(Name: [^\n]+
       Version: \d+.\d+.\d+
       URL: https?:\/\/(www\.)?.+
       Title: [^\n]*?
       Solution: upgrade to (~>|>=) \d+\.\d+\.\d+(\.\d+)?(, (~>|>=) \d+\.\d+\.\d+(\.\d+)?)*[\s\n]*?)/
       Diff:
       @@ -1,6 +1,12 @@
       -/(Name: [^\n]+
       -Version: \d+.\d+.\d+
       -URL: https?:\/\/(www\.)?.+
       -Title: [^\n]*?
       -Solution: upgrade to (~>|>=) \d+\.\d+\.\d+(\.\d+)?(, (~>|>=) \d+\.\d+\.\d+(\.\d+)?)*[\s\n]*?)/
       +/Users/etagwerker/Projects/rubymem/bundler-leak/lib/bundler/plumber/scanner.rb:61:in `read': No such file or directory @ rb_sysopen - /Users/etagwerker/Projects/rubymem/bundler-leak/spec/bundle/unpatched_gems/Gemfile.lock (Errno::ENOENT)
       +    from /Users/etagwerker/Projects/rubymem/bundler-leak/lib/bundler/plumber/scanner.rb:61:in `initialize'
       +    from /Users/etagwerker/Projects/rubymem/bundler-leak/lib/bundler/plumber/cli.rb:41:in `new'
       +    from /Users/etagwerker/Projects/rubymem/bundler-leak/lib/bundler/plumber/cli.rb:41:in `check'
       +    from /Users/etagwerker/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
       +    from /Users/etagwerker/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
       +    from /Users/etagwerker/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
       +    from /Users/etagwerker/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
       +    from /Users/etagwerker/Projects/rubymem/bundler-leak/bin/bundle-leak:10:in `<top (required)>'
       +    from /Users/etagwerker/Projects/rubymem/bundler-leak/bin/bundler-leak:3:in `load'
       +    from /Users/etagwerker/Projects/rubymem/bundler-leak/bin/bundler-leak:3:in `<main>'

     # ./spec/integration_spec.rb:29:in `block (3 levels) in <top (required)>'

  3) Bundler::Plumber::Scanner#scan should yield results
     Failure/Error: File.read(File.join(@root,gemfile_lock))

     Errno::ENOENT:
       No such file or directory @ rb_sysopen - /Users/etagwerker/Projects/rubymem/bundler-leak/spec/bundle/unpatched_gems/Gemfile.lock
     # ./spec/scanner_spec.rb:9:in `new'
     # ./spec/scanner_spec.rb:9:in `block (3 levels) in <top (required)>'
     # ./spec/scanner_spec.rb:14:in `block (3 levels) in <top (required)>'

  4) Bundler::Plumber::Scanner#scan when not called with a block should return an Enumerator
     Failure/Error: File.read(File.join(@root,gemfile_lock))

     Errno::ENOENT:
       No such file or directory @ rb_sysopen - /Users/etagwerker/Projects/rubymem/bundler-leak/spec/bundle/unpatched_gems/Gemfile.lock
     # ./spec/scanner_spec.rb:9:in `new'
     # ./spec/scanner_spec.rb:9:in `block (3 levels) in <top (required)>'
     # ./spec/scanner_spec.rb:21:in `block (4 levels) in <top (required)>'

  5) Bundler::Plumber::Scanner when auditing a bundle with unpatched gems should match unpatched gems to their advisories
     Failure/Error: File.read(File.join(@root,gemfile_lock))

     Errno::ENOENT:
       No such file or directory @ rb_sysopen - /Users/etagwerker/Projects/rubymem/bundler-leak/spec/bundle/unpatched_gems/Gemfile.lock
     # ./spec/scanner_spec.rb:29:in `new'
     # ./spec/scanner_spec.rb:29:in `block (3 levels) in <top (required)>'
     # ./spec/scanner_spec.rb:31:in `block (3 levels) in <top (required)>'
     # ./spec/scanner_spec.rb:34:in `block (3 levels) in <top (required)>'

  6) Bundler::Plumber::Scanner when auditing a bundle with unpatched gems when the :ignore option is given should ignore the specified advisories
     Failure/Error: File.read(File.join(@root,gemfile_lock))

     Errno::ENOENT:
       No such file or directory @ rb_sysopen - /Users/etagwerker/Projects/rubymem/bundler-leak/spec/bundle/unpatched_gems/Gemfile.lock
     # ./spec/scanner_spec.rb:29:in `new'
     # ./spec/scanner_spec.rb:29:in `block (3 levels) in <top (required)>'
     # ./spec/scanner_spec.rb:40:in `block (4 levels) in <top (required)>'
     # ./spec/scanner_spec.rb:43:in `block (4 levels) in <top (required)>'

Finished in 2.05 seconds (files took 0.24103 seconds to load)
44 examples, 6 failures

Failed examples:

rspec ./spec/integration_spec.rb:18 # CLI when auditing a bundle with unpatched gems should print a warning
rspec ./spec/integration_spec.rb:22 # CLI when auditing a bundle with unpatched gems should print advisory information for the leaky gems
rspec ./spec/scanner_spec.rb:11 # Bundler::Plumber::Scanner#scan should yield results
rspec ./spec/scanner_spec.rb:20 # Bundler::Plumber::Scanner#scan when not called with a block should return an Enumerator
rspec ./spec/scanner_spec.rb:33 # Bundler::Plumber::Scanner when auditing a bundle with unpatched gems should match unpatched gems to their advisories
rspec ./spec/scanner_spec.rb:42 # Bundler::Plumber::Scanner when auditing a bundle with unpatched gems when the :ignore option is given should ignore the specified advisories

Coverage report generated for RSpec to /Users/etagwerker/Projects/rubymem/bundler-leak/coverage. 309 / 358 LOC (86.31%) covered.
SimpleCov failed with exit 1%

Do you know why that could be happening?

etagwerker commented 5 years ago

My bad, this was happening when I run bundle exec rspec for the very first time.

When I run bundle exec rake it works fine. Any follow-up calls to bundle exec rspec work as well.