Installing Rails
For the purposes of this book, I am going to explicitly specify the version of Rails we want to use rather than just grabbing the latest stable version. I am doing this to ensure that the code examples work correctly several months from now. One catch when using the latest version of Rails is that the gems you want to use might not have been updated yet by their authors. This can lead to bugs being introduced that might not have an easy solution. I tend to lag one version behind (although I do keep an eye out for critical security patches) to ensure that I can build stable apps for my clients. The following command can be used to install Rails 4.0.3:
gem install rails -v 4.0.3 --no-ri --no-rdoc
Generating a Rails app
Rails comes with many helpful scripts, including one to generate a "vanilla" Rails application as follows:
rails new .
The preceding command will create the app in the current directory and automatically install the required gems. At this point, we can start...