Since the current Heroku buildpack version only supports ruby versions up to 2.1.2 using the default environment settings we need to use the STACK environment variable to enable Ruby versions >= 2.1.3 when pushing applications to anynines. As Heroku introduced support for stacks we need to specify the “cedar” stack to enable current ruby version support for our application.
Table of Contents
At first we need to specify the version within our Gemfile as usual:
source 'https://rubygems.org' ruby '2.2.0' ...
This will specify the Ruby version dependency for our application.
STACK environment variable
After pushing your application for the first time use the application identifier to set the STACK environment variable to “cedar”:
$> cf set-env <APP_NAME> STACK cedar
Push the Ruby application to anynines
Just re-push the application specifying the Heroku buildpack url as parameter. The STACK variable will be read during the buildpack execution (staging) phase. The buildpack will enable support for versions
$> cf push -b https://github.com/heroku/heroku-buildpack-ruby
Enjoy using latest Ruby versions on anynines.
This blog post is an adaption of an article written by our colleague Robert. Please have a look at his blog about technical topics too.