Why Is Heroku's Heroku-18 Stack Only Compatible with Puma Versions 3.7.X

Why is Heroku's heroku-18 stack only compatible with Puma versions 3.7.x?

The Heroku-16 stack is based on Ubuntu 16.04, which ships with OpenSSL 1.0.2 while the Heroku-18 stack is based on Ubuntu 18.04 which ships with OpenSSL 1.1.0.

Between these OpenSSL versions, there were quite some API and behavior changes which often requires some changes to software using OpenSSL APIs directly (like Puma does).

In Puma 3.7.0, there was a change to make it compatible with OpenSSL 1.1.0 which thus makes it the first version to be compatible with that version.

How can I solve this trouble to deploy a Rails App to Heroku?

I am posting solution might be late but can help other.
Solution most people posting asking to upgrade ruby version. Updating ruby version in an application might be time consuming some time.
But with below solution application can deploy without updating ruby version.

Current stack heroku uses is heroku-18, Having image of Ubuntu 18.04. It have minimum supported runtime is ruby 2.4.5, other information here.

To run aplication with below this ruby version you need to downgrade heroku stack for your application.

Open console and run heroku stack you will find.

  cedar-14
container
heroku-16
* heroku-18

You need to downgrade to stack which support your ruby version. For ruby 2.3.x you can set heroku-16

heroku stack:set heroku-16

Now if you run heroku stack you will find heroku-16 stack set for your application.

  cedar-14
container
* heroku-16
heroku-18

You might get security vulnerability issue on console, Information here.

Try update only sprockets gem to minimum 3.7.2 like:

bundle update sprockets --bundler '3.7.2'

Or you can set :

config.assets.compile = false # Disables security vulnerability

Run git push heroku master. Boom!! Your application deployed successfully.



Related Topics



Leave a reply



Submit