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

Heroku doesn't support differentiated Gemfiles #1348

Open
pvande opened this issue Dec 13, 2022 · 4 comments
Open

Heroku doesn't support differentiated Gemfiles #1348

pvande opened this issue Dec 13, 2022 · 4 comments

Comments

@pvande
Copy link

pvande commented Dec 13, 2022

I'm trying to set up dual-booting for my application, using a similar approach to the next_rails gem. Put simply, my application has a Gemfile/Gemfile.lock pair for the "stable" configuration, and a Gemfile.next/Gemfile.next.lock pair for the configuration being validated.

In my local environment, I can switch between these by setting BUNDLE_GEMFILE=Gemfile.next as necessary. In this way, my "next" environment can explore updates to Ruby, Rails, and other dependencies over the long-term without endangering my production app or holding up the development pipeline.

For all appearances, however, this buildpack doesn't play nicely with such a configuration. Bundler version inference, Ruby version inference, and initial gem installation are done (at least in part) based on the Gemfile.lock file, regardless of the value of BUNDLE_GEMFILE, which causes mismatches during build startup.

@schneems
Copy link
Contributor

I previously looked into this in #351 though that was a long time ago and quite a bit has changed.

This fork of the buildpack supports it https://www.fastruby.io/blog/how-to-run-multiple-versions-of-rails-on-heroku.html

@schneems
Copy link
Contributor

I've been thinking that it will be difficult to hunt down all the locations where it's expected that Gemfile/Gemfile.lock combination will be used at the root of the application.

An alternative way forward could be to detect when BUNDLE_GEMFILE is set to something different and then move those files into the root of the app before heroku/ruby runs.

We could make a micro buildpack that does this and not even need to touch heroku/ruby.

@edmorley edmorley changed the title Bug: Heroku doesn't support differentiated Gemfiles Heroku doesn't support differentiated Gemfiles Feb 6, 2024
@fbuys
Copy link

fbuys commented Mar 19, 2024

Hey @schneems I would like to attempt the micro buildpack you suggested, do you have any pointers to help me get started?

I have not created a buildpack before, am I over-ambitious?

@fbuys
Copy link

fbuys commented Mar 22, 2024

Hey @schneems we opened a PR that could potentially enable setting the Gemfile via an ENV value.
When you have a moment could you take a look and see if this could potentially be merged into the official buildpack?
fastruby#2

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

3 participants