More on heroku and Lucid

In my last post on heroku, django and Ubuntu Lucid I went through a fair old rigmarole and a lot of (Ruby illiterate) guesswork to get the Heroku toolchain working on Ubuntu Lucid (10.04 LTS).  Only a few days later Heroku published official Python and Django documentation.

Unfortunately, if you’re new to Ruby even Heroku’s excellent documentation isn’t quite enough… Essentially there’s still an assumption that you know what the hell you’re doing with Ruby.  Obviously for people steeped in Python this is not the case!

The Linux readme says the following:

apt-add-repository 'deb ./'
curl | apt-key add -
apt-get update
apt-get install heroku-toolbelt

That’s all very well, but it isn’t all the steps. To actually get the Heroku toolchain working on a previously Ruby-less Ubuntu Lucid install you’ll need to do the following:

sudo apt-get install ruby libopenssl-ruby libreadline-ruby curl
apt-add-repository 'deb ./'
curl | sudo apt-key add -
sudo apt-get update
sudo apt-get install heroku-toolbelt

Note the following:

  • Ruby is not a dependency of heroku-toolbelt, so you can install the toolbelt without Ruby
  • Just installing Ruby isn’t enough – you’ll get “no such file to load — net/https” unless you also install libopenssl-ruby
  • You’ll also get “no such file to load — readline” unless you also install libreadline-ruby
  • Without some faffing (that I’ve not done yet) you can’t install Foreman as Heroku recommends because the Lucid packaged version of RubyGems is too low to meet the dependencies. Personally I don’t see this as necessary for dev environments on smaller projects, but if I were to try a larger one this would need to be resolved

Hopefully this will help others new to Ruby trying to make the most of Heroku’s excellent infrastructure.