Closed dsabeti closed 1 year ago
hello @dsabeti ! Actually @pivotal-david-osullivan and I discussed that, and we'd prefer option 2: no check on the stack, but only on the presence of Ruby - so in case cflinuxfs5 brings Ruby back (who knows?!) it will be working fine.
As a Paketo/CF stacks maintainer I can state with a high degree of certainty that we won't be bringing ruby back into the stack :)
Checking for the presence of ruby
is even better than relying on the implicit knowledge of cflinuxfs3 having ruby, but is a bit more work that the existing solution in this PR.
Cool. I went ahead with option 2. I decided to move the call to util::environment::setup
inside the same if-block -- the thinking being that, if ruby exists already, those environment variables are probably already set up.
Looks good, thanks all!
If a user specifies a custom stack -- for example, a Paketo stack based on Ubuntu Jammy -- this check will fail and ruby will not be installed, causing the app to fail to stage.
This change skips installing ruby only when the specified stack is cflinuxfs3, which is known to include its own ruby.
I considered a few alternatives before landing on this one:
Checking for ruby using
which ruby
, as the code does in line 97. In this case, we may want to move the call toutil::environment::setup
into theif
block:I'm open to these other solutions, but unsure of their repercussions. I went with the least drastic change.