Install ruby-dev prior to rails as it is required for building gem.