Linode Ruby on Rails Setup Script
As I stated in my previous post I have just launched the redesign/redevelopment of my site.
Along with this change I am also using a new Virtual Machine Host called Linode I am sure you know of them from Rails Rumble
I have to say that I am very impressed with them so far. I have been on a lot of VPS solutions and this is one of the fastest I have used and above all the price can’t be beaten!
However before I deployed the new site, I had to install Ruby on Rails and all that goes along with it.
I made a shell script that automated the entire set up process including installing Passenger and the required libraries.
To start off, I opted to install Ubuntu 8.10 as my operating system of choice using the nifty interface provided by Linode.
After that I went about setting up the box, doing a bunch of apt-gets and a few wgets. So I thought that I would put all this set up into a bash shell script, just in case I had to do it again in the future or that it might help anyone else who needed a RoR quick set up.
So I went about looking at my history file and making the script. I then deleted my blank and configured vps and restored a brand new copy of Ubuntu to test if it actually worked so I could post it here with a certain degree of confidence.
So this is what the script installs:
- Ruby Gems
- Ruby
- Ruby on Rails (with version switch)
- Apache2
- Passenger (including the passenger module)
- Mysql 5
- RedCloth
- Vim
- Git
- haml (Because all your apps should be using this kick ass template language)
It also installs a few dependency libraries so all the above apps install.
All you have to do now is upload you app, and add a virtual host and away you go.
Passenger
I did have a few issues with passenger. For some silly reason I uploaded my app as root and tried to start Passenger. Passenger does not like this (rightfully so). If it detects that environment.rb is owned by root it bails So make sure that your app is not owned by root.
So all this talk and no link?
Here is the file
You wil notice that I have a few variables at the top. This is if you want to change the version of Ruby Gems or Rails. I am using the 2.1 branch, so the script sets the version to that. Pretty easy to change.
Let me know if anyone has any problems or improvements.
Hamza
Disqus
Comments