Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LicenseFinder fails to run on Ruby projects using non-standard path for bundler #862

Open
balasankarc opened this issue Nov 20, 2021 · 6 comments

Comments

@balasankarc
Copy link

If a project is using Ruby/Bundler from a non-standard location and license_finder is available from a different Ruby (like system Ruby), license_finder will fail to generate a report.

Consider the following example

  1. License Finder installed with system Ruby via gem install license_finder, and is available at /usr/local/lib/ruby.
  2. Project uses Ruby/Bundler from /custom-ruby (Ruby 2.7), and dependencies are installed using /custom-ruby/bin/bundle install and gets installed to /custom-ruby/lib/ruby/gems/2.7.0/gems/

image

Because LicenseFinder uses Bundler library under the hood, which default to the system location, it can't find the libraries there. Because this is not a case of bundle install --path=<path>, there is no reference of this custom path in the project files.

Proposal

A way to specify a custom Ruby/Bundler path to license_finder so that the Bundler library used under the hood will be from that location, and will look there for gems instead of system location.

@cf-gitbot
Copy link
Collaborator

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

@xtreme-shane-lattanzio
Copy link
Contributor

We made some changes with the new docker image. Not sure if it fixes this or not

@moeffju
Copy link

moeffju commented Mar 29, 2022

The workaround described in #828 fixed a similar issue for me, maybe it will work for you as well?

@stanhu
Copy link

stanhu commented Jun 7, 2022

Thanks! The workaround in #828 (comment) worked for me.

I noticed the problem also resolved if I commented out these lines:

::Bundler.reset!
::Bundler.configure

I wonder if those lines can now be dropped with Bundler v2.2+.

UPDATE: It seems this works only because the list of Bundler specs are empty?

@xtreme-shane-lattanzio
Copy link
Contributor

@stanhu This bundler section seems to be very finicky and we havent had time to dive into it. If we fix one situation it seems to break another. I'm glad you were able to find a workaround!

@Fire-Dragon-DoL
Copy link

Still struggling with this, I'm using bundle install --standalone and I can't get license finder to work properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants