Chapter 14. Deployment

 

This chapter covers

  • Deploying a Rails app to an Ubuntu server
  • Using RVM and Ruby in a server environment
  • Hosting a Rails app using the Passenger gem

In this chapter you’ll deploy your Ticketee application to a new Ubuntu install. Ubuntu is the preferred operating system for deploying Rails applications, mainly due to its simplicity of use and easy package management. You don’t need to install another operating system on your computer; you’ll be using a product called Oracle VM VirtualBox.

You’ll set up this machine manually so that you can see how all the pieces fit together. There are automatic tools such Puppet,[1] Chef,[2] Babushka,[3] and Git Pusshuten[4] that can do most, if not all, of this setup for you. To cover them all adequately in this chapter would turn the chapter into a book. Deployment is an enormous subject and different people have very different opinions of how it should be done. This chapter will give you an adequate taste of what parts are involved in setting up a server, but shouldn’t be considered as the be all and end all of deployment. There are countless ways to skin this cat.

This chapter covers the following processes:

14.1. Server setup

14.2. RVM and Ruby

14.3. Creating a user for the app

14.4. The database server

14.5. Deploy away!

14.6. Serving requests

14.7. Summary