Scalingo / ruby-buildpack

Ruby Buildpack for Scalingo
MIT License
5 stars 13 forks source link

Fail early and show an error when ruby version is not supported by the stack #49

Closed SCKevinO closed 1 year ago

SCKevinO commented 1 year ago

When trying to deploy an app with a ruby version not supported by the current stack, it would be nice to show an explicit error and stop the execution early, instead of letting the build continue and fail at some point with an error that is hard to understand and debug.

For example, when trying to deploy an app with ruby 2.7.8 on the scalingo-22 stack, we get that kind of error:

-----> Using Ruby version: ruby-2.7.8
-----> Installing dependencies using bundler 2.3.25
Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
Could not load OpenSSL.
You must recompile Ruby with OpenSSL support or change the sources in your
Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using
RVM are available at rvm.io/packages/openssl.
Bundler Output: Could not load OpenSSL.
You must recompile Ruby with OpenSSL support or change the sources in your
Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using
RVM are available at rvm.io/packages/openssl.

!
! Failed to install gems via Bundler.
!
! An error occurred during buildpack compilation
! Error deploying the application
! → Invalid return code from buildpack 
guillaume-sc commented 1 year ago

We base our buildpack on Heroku's, and we don't have the necessary bandwidth to handle such case.