Book Image

Ruby on Rails Enterprise Application Development: Plan, Program, Extend

By : Elliot Smith, Rob Nichols
Book Image

Ruby on Rails Enterprise Application Development: Plan, Program, Extend

By: Elliot Smith, Rob Nichols

Overview of this book

<p><br />All businesses have processes that can be automated via computer applications, thereby reducing costs and simplifying everyday operations. This book demonstrates that a modern web application framework makes an ideal platform for such applications. It shows how the attributes that make the Rails framework so successful for Internet applications also provide great benefit within a business intranet. These attributes include easy roll-out and update of applications, centralized processing and data handling, simple maintenance, straightforward code development, and scalability.<br /><br />Ruby on Rails is an open-source web application framework ideally suited to building business applications, accelerating and simplifying the creation of database-driven websites. Often shortened to Rails or RoR, it provides a stack of tools to rapidly build web applications based on the Model-View-Controller design pattern.<br /><br />This book covers topics such as installing Ruby, Rubygems, and Rails on Windows, Linux, and Mac OS X; choosing and installing a database; installing an IDE for Rails development; setting up a Subversion repository to manage your code; creating a new Rails application; understanding Rails models; understanding controllers and views; improving user interfaces with Ajax; using Rails plugins to manage file uploads; using Capistrano to manage application deployment; techniques for scaling Rails applications, such as caching and using Apache to proxy through to the Mongrel server. The example application is straightforward to develop, easy to roll out, and simple to maintain.</p>
Table of Contents (16 chapters)
Ruby on Rails Enterprise Application Development
Credits
About the Authors
Preface
Index

Appendix A. Running Your Own Gem Server

Rubygems is a great system for maintaining libraries for use with Ruby. It makes it simple to upgrade to new versions of Rails, Capistrano, Mongrel, etc. with a single command.

However, if you use a default Rubygems configuration, each time a developer installs a gem they fetch it from a repository on the Internet. This could result in different developers ending up with different versions of a single gem, depending on which was available when they performed the installation. While this might not make a difference in some cases, with gems like Rails (which change radically between versions), it could result in an application working on one machine and not on another.

Another issue is finding the more obscure gems, which reside in non-standard repositories. In this case, configuring the developers' machines for each non-standard repository can be painful, particularly if you use several such repositories.

The simplest way to give developers access to a consistent repository with all the gems they require is to set up your own gem server. There are two methods for doing this:

  1. If you have a machine with all the required gems installed, you can use the built-in gem_server command on that machine to serve up its gems to others.

  2. You can serve gems out of Apache by manually setting up a gem repository. This gives you more control over which gems are presented to client machines, but is harder to maintain.

Both techniques are covered in the next two sections.