Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Heroku-22 and no system Ruby #16

Open
edmorley opened this issue Jun 26, 2022 · 3 comments
Open

Heroku-22 and no system Ruby #16

edmorley opened this issue Jun 26, 2022 · 3 comments

Comments

@edmorley
Copy link

edmorley commented Jun 26, 2022

Hi!

The Heroku-22 stack was just released:
https://devcenter.heroku.com/changelog-items/2429

In Heroku-22, there is no longer a system install of Ruby:
https://devcenter.heroku.com/articles/heroku-22-stack#system-ruby-is-no-longer-installed

This buildpack is written entirely in Ruby, and so in order for this buildpack to work on Heroku-22, one of the following will be necessary:

  1. Have the buildpack vendor Ruby for use by this script (for an example of a buildpack doing this, see Vendor Ruby if an installation is not found heroku/heroku-buildpack-nginx#103).
  2. Convert the buildpack to use shell/bash scripts instead.
  3. Have users of this buildpack add the heroku/ruby buildpack prior to this one (they will also need to add a minimal Gemfile to their app source, if not already present, so the Ruby buildpack passes detection). However if mysql is needed before a Ruby MySQL gem is installed, this option might not be viable for this buildpack.
  4. Use the APT buildpack to instead install mysql CLI from Ubuntu's APT repo (or else a PPA repo), and sunset this buildpack.
@stebogit
Copy link

Hey @edmorley would you mind suggesting a "minimal Gemfile" that would just work with the heroku/ruby buildpack? I'd like to try your suggested option 3, but I have no knowledge of ruby whatsoever and our app is PHP based, so I'm lost here.

@edmorley
Copy link
Author

edmorley commented Nov 1, 2022

Hi! An empty Gemfile might work - I'm not the Ruby buildpack maintainer, so I don't know for sure and would have to experiment.

However I would strongly recommend one of the other options here.

Looking at this buildpack again now, I see it's using mysql 5.5 which is quite out of date.

As such, I would recommend option (4) over the others - particularly given that mysql libs are already installed in the stack images from APT - so installing the CLI from there too is more consistent.

See:
https://github.com/heroku/heroku-buildpack-apt

I believe the package you'll need is mysql-client:
https://packages.ubuntu.com/jammy-updates/mysql-client

@stebogit
Copy link

stebogit commented Nov 2, 2022

Thanks but I do need the old MyQSL version.

After some trial and error I figure out both a Gemfile AND a Gemfile.lock files are required.
The following ones seem to be working:

# Gemfile
source 'https://rubygems.org'
# Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:

PLATFORMS
  ruby

DEPENDENCIES

BUNDLED WITH
   1.17.3

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

No branches or pull requests

2 participants