O'Reilly logo

Capistrano and the Rails Application Lifecycle by Tom Mornini, Marc Loy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Environments

Environments are application instances that are independent of one another. An environment can consist of one or more physical systems. One or more physical systems can support one or more environments as well. The key point of an environment is its independence and isolation from other environments. Rails has built-in support for environments in its configuration system, and Capistrano can be configured to deploy an application to more than one environment.

Historically, supporting multiple environments with the ease that Rails and Capistrano provide has been a very difficult endeavor on all but the most mature frameworks. The result is that many web applications are developed and deployed in less than ideal circumstances.

Development and Testing

Rails has the fastest development and testing environment setup that I’ve ever seen. Once Rails is installed on your system, all you need to do to get a well-written Rails application running in development mode is:

  1. Check out code from the repository

  2. Change to the top-level directory of the application

  3. Create DB user and blank schema to match config/database.yml (development and testing)

  4. Type rake migrate to install Schema and static data

  5. Type rake to run unit and functional tests

  6. Debug from output, install missing gems, and repeat step 5

  7. Open the browser and access http://127.0.0.1:3000 to use the application

You now have an isolated development and testing environment that is running the current code at the time of checkout. If your ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required