27.02.2013 Views

Rails%203%20In%20Action

Rails%203%20In%20Action

Rails%203%20In%20Action

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Summary<br />

the root account on this machine, as everything can be managed by your user or the<br />

application’s user.<br />

Then we had you set up a database server using PostgreSQL, one of the most popular<br />

relational datastores today. You discovered that giving your system user the same<br />

name as your database came in handy; PostgreSQL supports a kind of authentication<br />

that automatically grants a system user access to a database with the same name. That<br />

is of course provided a PostgreSQL user and database exist with that name. Very<br />

handy!<br />

Second-to-last, you got down to the meat of the chapter: the first deployment of<br />

your application to your server using Capistrano. You saw that the config/deploy.rb file<br />

comes in handy, allowing you to specify the configuration of your deployment environment<br />

simply. With Capistrano, you distill everything you need to get your application’s<br />

latest code onto the server down to one command: cap deploy:migrations.<br />

Every time you need to deploy, run this command, and Capistrano (along with your<br />

configuration) will take care of the rest.<br />

Finally, you set up nginx and Passenger to serve your application’s requests, as well<br />

as the static assets of your application. Generally, this is the setup preferred by Rails<br />

developers, and so there’s a lot of useful knowledge out there. An alternative to this<br />

setup would be to use the Apache web server instead of nginx. Both work suitably.<br />

That’s your application done, really. From the first time you ran a test all the way<br />

up to deployment, you’ve covered a lot of important things within Rails. There’s still<br />

much more to learn (which is why there are more chapters after this one), but right<br />

now you should have a firm grasp of what the process of developing and deploying a<br />

Rails application is. In the next chapter, we show you how you can let people authenticate<br />

to your application through either Facebook or Twitter.<br />

411

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!