I’ll introduce how to change the Ruby version used on Heroku.
First, check the Ruby version currently used on Heroku with the heroku stack command.
$ heroku stack
aspen-mri-1.8.6
* bamboo-mri-1.9.2
bamboo-ree-1.8.7
cedar (beta)
To change the Ruby version used on Heroku, use the heroku stack:migrate command.
This time I’m changing from 1.9.2 to 1.8.7, so I’ll specify bamboo-ree-1.8.7.
$ heroku stack:migrate bamboo-ree-1.8.7
-----> Preparing to migrate redmine-bkr
bamboo-mri-1.9.2 -> bamboo-ree-1.8.7
NOTE: You must specify ALL gems (including Rails) in manifest
Please read the migration guide:
http://devcenter.heroku.com/articles/bamboo
-----> Migration prepared.
Run 'git push heroku master' to execute migration.
After running heroku stack:migrate, the Ruby version change is scheduled.
The Ruby version will actually be changed the next time you git push.
At this point, you need to edit some file since you can’t git push without changes, so you need to add a line break to some file or make similar edits.
When you git push to Heroku, the log will include something like this:
$ git push heroku master
-----> Heroku receiving push
-----> Migrating from bamboo-mri-1.9.2 to bamboo-ree-1.8.7
-----> Migration complete, your app is now running on bamboo-ree-1.8.7
Finally, check the Ruby version with the heroku stack command, and if it’s properly changed, you’re done.
$ heroku stack
aspen-mri-1.8.6
bamboo-mri-1.9.2
* bamboo-ree-1.8.7
cedar (beta)
That’s all from the Gemba about wanting to change the Ruby version used on Heroku.