Skip to Content
Ruby on Rails® for Microsoft Developers
book

Ruby on Rails® for Microsoft Developers

by Antonio Cangiano
April 2009
Intermediate to advanced content levelIntermediate to advanced
479 pages
12h 55m
English
Wrox
Content preview from Ruby on Rails® for Microsoft Developers

11.4. A Few Enterprise Pointers

Before letting you go and wrapping up this chapter, I'd like to provide you with a few pointers about "enterprise-y" topics that may interest you.

  • Because you can use the method establish_connection on a per model basis, it is possible to let Rails applications communicate with multiple databases. A starting point is the wiki article: http://wiki.rubyonrails.org/rails/pages/HowtoUseMultipleDatabases.

    Freeze Your Application

    One common deployment issue is having different Rails versions on your development machine and your production server. An easy way to guarantee that your code will work in production, no matter what version of Rails is installed, is to "freeze your application" by copying your local Rails version within the vendor\rails directory. This process is entirely automated by running rake rails:freeze:gems. The reverse action is rake rails:unfreeze, which will remove the local copy.

    Likewise, it is possible to freeze the non-Rails gems required by your application by running rake gems:unpack (or gems:unpack:dependencies to include the dependencies as well). These gems will be placed in the vendor\gems directory of your project.

    Once Rails and the required gems are frozen, you can deploy your application without worrying about mismatching versions.

  • To work with Legacy schemas you may have to overwrite some conventions via configuration. A good starting point is the previously mentioned wiki article: http://wiki.rubyonrails.org/rails/pages/howtouselegacyschemas ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Ruby on Rails™ 3 Tutorial: Learn Rails™ by Example

Ruby on Rails™ 3 Tutorial: Learn Rails™ by Example

Michael Hartl

Publisher Resources

ISBN: 9780470374955Purchase book