I always try to get my clients to use the right host for them. In many cases this can be a VPS or dedicated host. When clients choose VPS or dedicated hosting, responsibility for setting up and maintaining the box belongs to me (at least as far as the site’s production environment is concerned). That means I spend some time installing rails on clean hosts that have never had anything on them before. Below are the 12 steps I use to setup a new box for rails. It does assume that you already have apache setup and running, if you prefer nginx, adjust accordingly

 

  1. sudo apt-get install git-core ruby1.8 build-essential libssl-dev ruby rdoc irb libopenssl-ruby imagemagick libmagick9-dev ruby1.8-dev libmysqlclient15-dev apache2-prefork-dev libapr1-dev postfix libaprutil1-dev #install some prerequisites
  2. wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.6.tgz #you can change the version of rubygems
  3. tar -xzf rubygems-1.3.6.tgz #but make sure to change it here too
  4. cd rubygems-1.3.6 #and here
  5. sudo ruby setup.rb #this installs rubygems 
  6. sudo gem1.8 install rails #notice the gem1.8 thats default so as not to clash with system wide version of gem
  7. sudo gem1.8 i aws-s3 #I use this a lot, no harm in having it intalled if not used, so it gets a step
  8. sudo gem1.8 install –version=2.12.2 rmagick #later versions of rmagic do not work with packaged versions of imagemagick, this helps avoid that problem
  9. sudo gem1.8 install mysql
  10. sudo gem1.8 install passenger
  11. sudo passenger-install-apache2-module #follow the on screen instructions
  12. configure things like disabling tls for postfix and your applications path.

This does assume that you have apache installed, that you want to use apache and that you want to use postfix. Some of the gems (and their dependencies) are optional, but I use them a lot for example imagemagick is used for pretty much all inline image manipulations. Don’t forget to disable postfix tls (or properly configure it). You will also notice I did not install mysql server. If you want to run it on the same host as your web server then install it, otherwise install t on a diffrent server, the client libs are all you need for rails.

 

 

Coteyr.net Programming LLC. is about one thing. Getting your project done the way you like it. Using Agile development and management techniques, we are able to get even the most complex projects done in a short time frame and on a modest budget.

Feel free to contact me via any of the methods below. My normal hours are 10am to 10pm Eastern Standard Time. In case of emergency I am available 24/7.

Email: coteyr@coteyr.net
Phone: (813) 421-4338
GTalk: coteyr@coteyr.net
Skype: coteyr
Guru: Profile