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

bundle_command changes surprisingly when using a different Gemfile location #855

Open
makmic opened this issue Sep 6, 2024 · 0 comments

Comments

@makmic
Copy link

makmic commented Sep 6, 2024

Hi 👋

I had some fun yesterday debugging why my rake commands in the schedule.rb somehow yielded different results than before without having changed anything to whenever.

It turns out, the bundle_command default is determined like so:

set :bundle_command, Whenever.bundler? ? "bundle exec" : ""

..which is tied to:

whenever/lib/whenever.rb

Lines 31 to 33 in 0687268

def self.bundler?
File.exist?(File.join(path, 'Gemfile'))
end

Well. My seemingly unrelated change of the day was to move the Gemfile into a different location (say something like Gemfile-ruby33) and point the BUNDLE_GEMFILE env variable to that location. That's not too common, but the standard way to do so (see https://bundler.io/v2.5/man/bundle-config.1.html#LIST-OF-AVAILABLE-KEYS and bundle config gemfile)

I suggest to adjust Whenever#bundler? in a way that works in that scenario as well.

Thanks!

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

No branches or pull requests

1 participant