Introducing Speedy — Painless Rapid Rails Deployment
Speedy was a Ruby gem I built to make deploying Rails apps on Apache + Passenger painless during development.
I wrote this in 2009 when I was building a lot of Rails apps and deploying each one was its own small hell. Speedy was my attempt to make that part painless. The gem isn't maintained anymore — Rails has moved on, my stack has moved on — but the article stays up as a record of what I was building and what I was learning at the time.
If you're a Rails developer I hope you too hate to run ./script/server command all the time to start the application server during the development phase. Fortunately Phusion came up with a revolutionized solution to host the Rails application on Apache server using Passenger (aka mod_rails).
To deploy a web application on Apache using Passenger you should perform following initial server configurations.
- Create a virtual host
- Add an entry to the hosts file
- Enable the website
- Finally restart the Apache web server
Apparently this is a repetitive task, no doubt it sucks your valuable time for each and every application that you develop and deploy.
Before I bought my MacBookPro, I used Debian based Linux distros like Ubuntu and LinuxMint for my development. So, at that time I noticed that Mac people have a simple solution called Passenger preference pane, which allows them to drag and drop project and deploy. I really inspired by that and I always wanted to create such an automated tool which can use by all Rails developers despite of the platform. So I thought the best solution for this is to create a Ruby gem.
So, as soon after finishing my final year exams, I sat and write the specifications for the tool. First I thought to call this tool as "FireRails". But, finally it became "Speedy".
I've hosted the Speedy on RubyGems, so that you can install in the native way.
sudo gem install speedyTo deploy a web application navigate to the particular application root folder via terminal and simply type:
sudo speedy deploy(Since Speedy deals with many system level commands, you always need to run Speedy with administrator credentials.)
If you need, you can pass the desired hostname for above command.
sudo speedy deploy example.localIf not Speedy will create a hostname and deploy the site with the name of the root folder, enable the site and finally restart the Apache server. All these operations will only take less than 2 seconds, as the name implies.
In addition to that, you can use Speedy for maintain Apache-Passenger clean configurations.
Currently, Speedy supports Debian/Ubuntu variants only. Hopefully, next release will support both Mac and Linux, and my ultimate goal is to develop Speedy, to use it in production servers, very easily and very happily.