When Heroku first launched you could only use one version of Ruby: 1.8.6. As the Ruby implementation matured and improved, so did Heroku. We recently announced the ability to specify your ruby version on Heroku, and we are happy to announce the first preview-build of Ruby available: starting today you can use Ruby 2.0 preview1 on Heroku.
The Ruby core team has been hard at work on Ruby 2.0, which has a host of new features and boasts performance improvements. You can get a list of the major new features on the official Ruby 2.0.0 Preview1 announcement.
Heroku has been committed to the Ruby project by sponsoring the work of Yukihiro "Matz" Matsumoto, Koichi Sasada and Nobuyoshi Nakada on MRI Ruby. We have been very pleased with Ruby Core's progress, and look forward to the full release. You can take an in-depth look at the new Ruby 2.0 features available. But don't just read about it, try it out on Heroku today:
Start by making a
Gemfile that specifies Ruby 2.0.0:
$ echo 'source "https://rubygems.org"' > Gemfile $ bundle install $ echo 'ruby "2.0.0"' >> Gemfile
Add the files to a Git repository:
$ git init $ git add . $ git commit -m "Ruby 2.0.0 preview on Heroku"
Then create a new heroku app and deploy:
$ heroku create $ git push heroku master -----> Heroku receiving push -----> Ruby app detected -----> Using Ruby version: ruby-2.0.0 -----> Installing dependencies using Bundler version 1.2.1 Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment The Gemfile specifies no dependencies Your bundle is complete! It was installed into ./vendor/bundle Cleaning up the bundler cache. -----> Discovering process types Procfile declares types -> (none) Default types for Ruby -> console, rake -----> Compiled slug size: 23.3MB -----> Launching... done, v4 http://safe-earth-3679.herokuapp.com deployed to Heroku To firstname.lastname@example.org:safe-earth-3679.git * [new branch] master -> master
Now you can run Ruby 2.0 beta on Heroku!
$ heroku run bash Running `bash` attached to terminal... up, run.1 ~ $ ruby --version ruby 2.0.0dev (2012-11-01 trunk 37411) [x86_64-linux] ~ $ ruby -e "puts 'hello world'" hello world
Ruby 2.0 will ship on February 24th, 2013 - which is four days before our developer conference Waza. Heroku's own Matz has announced that Rails 3.2 apps should work with Ruby 2.0 if they work on Ruby 1.9. Help us find any incompatibilities by checking your existing applications on Heroku. If you run into any bugs in the Ruby implementation, please open a bug in the Ruby bug tracker and let the Ruby team know what didn't work with the implementation.
If you are updating an existing app you will likely need to update your config vars manually. New apps should not experience any problems.
Thanks to the entire Ruby Core Team for their hard work on this release of Ruby, and special thanks to Terence Lee. Terence is Heroku's Ruby buildpack maintainer who did the leg work to enable Ruby 2.0.0 Preview1 on Heroku. Please try out this Ruby preview today, to help the Ruby core team and to help our community. Try it today.