<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/atom10full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
  <title>BuildingWebApps Articles</title>
  
  <link href="/feeds/articles" rel="alternate" />
  <id>http://buildingwebapps.com/articles</id>
  <updated>2008-08-27T00:00:00Z</updated>
  <author>
    <name>BuildingWebApps.com</name>
  </author>
  <link rel="self" href="http://feeds.feedburner.com/buildingwebappsarticles" type="application/atom+xml" /><entry>
    <title>Enhancing Conditional Routing in Rails</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/376484167/7082-enhancing-conditional-routing-in-rails" rel="alternate" />
    <id>http://buildingwebapps.com/articles/7082-enhancing-conditional-routing-in-rails</id>
    <updated>2008-08-27T00:00:00Z</updated>
    <author>
      <name>Christopher Haupt</name>
    </author>
    <summary>Rails' routing infrastructure supports the concept of conditional routes: preconditions that must be satisfied before a particular route will trigger. Rails 2.1 supports one built-in condition, HTTP method checking, which is of some use but rather limited. What I needed was to be able to limit certain routes to only trigger when a particular host-name was used to access the application. I show one implementation in this article.</summary>
    <content type="html">
Rails' routing infrastructure supports the concept of conditional routes: preconditions that must be satisfied before a particular route will trigger. Rails 2.1 supports one built-in condition, HTTP method checking, which is of some use but rather limited. What I needed was to be able to limit certain routes to only trigger when a particular host-name was used to access the application.  

I thought I'd have to write messy additional logic until a little comment tucked away in ActionController::Routing::RouteSet and ActionController::Routing::Routing caught my eye. Here I briefly show you how to leverage this functionality for your own purposes.

h2. The Goal -- Conditional Routes in routes.rb

Let's work backwards and see the result I was aiming for. I wanted to expand the existing capabilities of the routing engine and be able to restrict routes to specific hosts. The conditional routing option works by adding a parameter to your route specifications. Here are some examples:

&lt;pre&gt;
map.with_options(:controller =&gt; 'feeds', :conditions =&gt; {:hosts =&gt; MY_HOSTS}) do |feed|
  feed.feeds_articles '/feeds/articles', :action =&gt; 'articles'
  feed.feeds_podcast '/feeds/podcast', :action =&gt; 'podcast'
end
&lt;/pre&gt;

or

&lt;pre&gt;
map.resources :podcasts, :conditions =&gt; {:hosts =&gt; MY_HOSTS}, 
   :member =&gt; {:show_notes =&gt; :get, :transcript =&gt; :get},
   :collection =&gt; {:admin =&gt; :get} do |podcast|
     podcast.resources :comments, :member =&gt; {:report_as_ham =&gt; :get, :report_as_spam =&gt; :get}
   end
&lt;/pre&gt;

or even

&lt;pre&gt;
map.connect ':controller/:action/:id', :conditions =&gt; {:hosts =&gt; MY_HOSTS}
&lt;/pre&gt;

In Rails 2.1, however, no such option @:hosts@ exists, only an option to check the HTTP method via @:method@.

h2. The Implementation

I haven't really ever needed to use the conditional routing support before, and didn't really think about it due to it only supporting the HTTP method check. For that reason, I originally thought I'd have to write my own logic, either patching existing Routing routines (nearly right!) or by writing new stuff that could get messy (bad idea).

During a last scan through the code for the keyword "conditions", I saw this comment:

&lt;pre&gt;
# Plugins may override this method to add other conditions, like checks on
# host, subdomain, and so forth. Note that changes here only affect route
# recognition, not generation.
&lt;/pre&gt;

Good, a place to start afterall! The solution is elegant as it only requires overriding two simple routines. You can do this in your own app by writing code that gets loaded at startup. Here is one implementation in its entirety:

&lt;pre&gt;
require 'action_controller'

module ActionController
  module Routing
    class RouteSet
      def extract_request_environment(request)
        { :method =&gt; request.method, :host =&gt; request.host }
      end
    end

    class Route
      def recognition_conditions
        result = ["(match = #{Regexp.new(recognition_pattern).inspect}.match(path))"]
        result &lt;&lt; "conditions[:method] === env[:method]" if conditions[:method]
        result &lt;&lt; "conditions[:hosts].include?(env[:host])" if conditions[:hosts]
        result
      end
    end
  end
end	
&lt;/pre&gt;

My code is very simplistic and tuned for my needs, but gives you an example of where to patch in. Here, I simply supply a list of host names I care about, and check the incoming host against that list.

Use @extract_request_environment@ to parse out and store any data you will want to use in your conditional checks. This data will be available in the @env@ hash later on.

@recognition_conditions@ generates an Array of String objects that contain the Ruby code that will be used to build dynamic conditional test methods when the routing engine compiles the routes data in @routes.rb@.

I drop the source file into my project's pre-existing @lib/plugins/action_controller_extensions/lib@ directory as @action_controller_extensions.rb@ and include an @init.rb@ loader stub in my @lib/plugins/action_controller_extensions@ directory:

&lt;pre&gt;
require 'action_controller_extensions'	
&lt;/pre&gt;

My app deals with loading up such "plugins" at startup. You may have a different set-up. You can get the same effect by putting a @require@ for the main source file in your startup code.

It would be great to see other generally useful conditionals contributed by the community. 

    &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=D73TO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=D73TO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=H8IqO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=H8IqO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=1Powo"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=1Powo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/buildingwebappsarticles/~4/376484167" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://buildingwebapps.com/articles/7082-enhancing-conditional-routing-in-rails</feedburner:origLink></entry>
  <entry>
    <title>Startup Camp and Foo Camp</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/345381746/6513-startup-camp-and-foo-camp" rel="alternate" />
    <id>http://buildingwebapps.com/articles/6513-startup-camp-and-foo-camp</id>
    <updated>2008-07-21T00:00:00Z</updated>
    <author>
      <name>Michael Slater</name>
    </author>
    <summary>I feel lucky to have been able to attend last week's Startup Camp and Foo Camp. These are unusual, invitation-only events, with extraordinary collections of people. Getting an invitation requires some mix of accomplishment, connections, and luck.</summary>
    <content type="html">
I feel lucky to have been able to attend last week's Startup Camp and Foo Camp. These are unusual, invitation-only events, with extraordinary collections of people. Getting an invitation requires some mix of accomplishment, connections, and luck.

They are exclusive events not for the sake of exclusivity, but because they only work at a limited size. "O'Reilly Media":http://oreilly.com/about/, which hosts the events and foots the bill (there's no registration fee), gets to pick the attendees from its diverse range of colleagues and contacts.

h2. Startup Camp

This was the first-ever Startup Camp, created by O'Reilly's venture fund, "O'Reilly Alpha Tech Ventures":http://oatv.com. OATV set up a two-day program, with a variety of startup veterans to give talks and lead discussions, and invited startups to apply. We were fortunate to be one of the "7 startups accepted":http://www.oatv.com/foo -- doubly so because getting into Startup Camp provided a much-sought-after invitation to Foo Camp as well.

The companies invited to Startup Camp spanned an incredibly broad range, from  custom jewelry for tweens  ("WhirlyBelle":http://whirlybelle.com from Replicator) to open-source server management software (Puppet from "Reductive Labs":http://reductivelabs.com) and open-source synthetic biology ("Ginkgo BioWorks":http://ginkgobioworks.com/).

The presenters included Tim O'Reilly and Dale Dougherty (O'Reilly), Bryce Roberts (OATV), Esther Dyson, Evan Williams (Blogger, Twitter), Marc Hedlund (Wesabe), Michael Arrington (TechCrunch), Mark Fletcher (Bloglines), Dave McClure (500 Hats), Howard Morgan (First Round Capital), and Kathy Sierra (Creating Passionate Users).

&lt;div style='width:650px; float:left:padding-right:10px'&gt;

!/assets/foo_camp_08-1.jpg!

&lt;/div&gt;

Since this was an off-the-record session, you won't see much reporting of the content, and I can't add much to that either. Keep it in mind next summer if you find yourself leading a new startup and want to apply.

Dave McClure's "Startup Metrics for Pirates":http://www.slideshare.net/dmc500hats/startup-metrics-for-pirates-foo-camp-2008 presentation is one talk whose slides have been made public. And the "Entrepreneurial Proverbs" session was inspired by older blog posts by the two presenters, "Evan Williams":http://evhead.com/2005/11/ten-rules-for-web-startups.asp and "Marc Hedlund":http://radar.oreilly.com/2006/03/entrepreneurial-proverbs.html.

h2. Foo Camp

As exciting as Startup Camp was, it was a prelude to the much larger Foo Camp.

Foo Camp was created by Tim O'Reilly and his colleague Sara Winge in 2003, and John Battelle wrote one of the "first articles":http://www.cnn.com/2004/TECH/ptech/01/09/bus2.feat.geek.camp/ about it. The name nominally stands for Friends Of O'Reilly, and it is also a play on the use of "foo" as a stand-in variable name in programming examples (a practice that, incidentally, dates back to the 1960's). Tim wrote about "why Foo Camp":http://radar.oreilly.com/2007/06/foo-camp-takeaways.html last year.

The business rationale for Foo Camp is that it gives the O'Reilly team the opportunity to talk with hundreds of leading-edge thinkers, as they look for ideas for books and conferences.

&lt;div style='width:650px; float:left:padding-right:10px'&gt;

!/assets/foo_camp_08-5.jpg!

&lt;/div&gt;

There's actually camping at Foo Camp: while many attendees stay at local hotels, a lot of them camp on the back lawn, and inside the office buildings, at O'Reilly. (For me, it's only a five-minute drive, since O'Reilly is in my home town of Sebastopol, CA.)

O'Reilly aims to have about 250 people at Foo Camp, which requires turning away a lot of past attendees so they can invite lots of new people each year. 

Among the well-known entrepreneurs and technologists attending this year were Jimmy Wales, Joshua Schacter, Steven Souders, Adrian Holovaty, Tom Coates, Scott Berkun, Ze Frank, Dries Buytaert, and Caterina Fake. That's just a random selection of the better known names. There were dozens of other well-known folks, and dozens more inspired, creative folks who have lower profiles.

Most of O'Reilly's editors and conference directors were there, as well as many of its authors. "OATV's portfolio companies":http://oatventures.com/investments/ were also well represented.

&lt;div style='width:650px; float:left:padding-right:10px'&gt;

!/assets/foo_camp_08-2.jpg!

&lt;/div&gt;

Foo Camp popularized the "unconference" format, in which the attendees create the program. The sponsors provide a chart with a grid of rooms and meeting times, and the attendees fill it in as they desire.

The unconference format is best known from the proliferation of "Bar Camps":http://barcamp.org/, which were inspired by the early Foo Camps. (More geek humor here, as in foobar.)

When this format was new, people were often hesitant to propose sessions, but no longer. The schedule board was 80% full within minutes. There's so many parallel tracks, and so many fascinating people, that you can only see a fraction of what goes on and meet a scattering of people.

&lt;div style='width:650px; float:left:padding-right:10px'&gt;

!/assets/foo_camp_08-3.jpg!

&lt;/div&gt;

One of my favorite sessions was on *The Future of News*. Both news, as journalism, and newspapers, as businesses, are in a period of dramatic change and stress. Presenters included "Monica Guzman":http://blog.seattlepi.nwsource.com/netnative/bio.asp#bio100435 of the Seattle Post-Intelligencer, "John Markoff":http://topics.nytimes.com/top/reference/timestopics/people/m/john_markoff/index.html and
"Nick Bilton":http://nickbilton.com/ from the New York Times, "Steven Levy":http://www.stevenlevy.com/ from NewsWeek, and
"Carl Malamud":http://public.resource.org.

Other interesting sessions I joined covered topics including ubiquitous computing, curation vs. crowd-sourcing, pragmatic thinking and learning (Andy Hunt), personal genomics (Esther Dyson, 23andMe), and aggregation vs. copyright.

&lt;div style='width:650px; float:left:padding-right:10px'&gt;

!/assets/foo_camp_08-6.jpg!

&lt;/div&gt;

Tim O'Reilly debated Michael Arrington on whether it is important for Microsoft to develop its own search technology, or if getting it from Yahoo is a reasonable strategy. Danny Sullivan moderated. And yes, that is an inflatable elephant.

Here's the pair of blog posts that inspired this session:

* "Why Search Isn't the Point":http://radar.oreilly.com/2008/05/why-search-competition-isnt-the-point.html, by Tim O'Reilly
* "The Importance of a Competitive Search Market":http://www.techcrunch.com/2008/05/25/the-importance-of-a-competitive-search-market/, by Michael Arrington

h2. Retrospection

I have no doubt that this event serves O'Reilly well, but it nevertheless is a great contribution to the community. Rarely is such a diverse collection of extraordinary people brought together under such casual, low-pressure surroundings.

Looking back on Foo Camp, there are so many people I wish I had been able to spend time with, and sessions I wish I had attended. I'll just have to hope for another invitation in years to come.

As someone who spent a decade running conferences, I at first found the unconference format unsettling. The completely self-organizing nature of the event means that its quality is determined entirely by the attendees. But with a crowd like this one, that's a good thing.

h2. More Foo Stuff

* "Laughing Squid's Pictures":http://laughingsquid.com/foo-camp-2008-photos/
* "Joi Ito's Pictures":http://www.flickr.com/photos/joi/sets/72157606108716088/
* "Michael Arrington's article":http://www.techcrunch.com/2008/07/14/foo-camp-2008-shangri-la-for-geeks/
* "James Hamilton's article":http://perspectives.mvdirona.com/2008/07/14/FooCamp2008.aspx
* "Scott Berkun's article":http://www.scottberkun.com/blog/2008/what-i-learned-at-foo-camp-08/
    &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=LkxGO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=LkxGO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=kBZJO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=kBZJO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=K1f6o"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=K1f6o" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/buildingwebappsarticles/~4/345381746" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://buildingwebapps.com/articles/6513-startup-camp-and-foo-camp</feedburner:origLink></entry>
  <entry>
    <title>Setting up Rails on Tiger (Mac OS X 10.4)</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/345381744/6455-setting-up-rails-on-tiger-mac" rel="alternate" />
    <id>http://buildingwebapps.com/articles/6455-setting-up-rails-on-tiger-mac</id>
    <updated>2008-07-20T00:00:00Z</updated>
    <author>
      <name>Christopher Haupt</name>
    </author>
    <summary>This guide walks you through setup instructions for preparing a Mac OS X 10.4 (aka Tiger) development machine to be used for general Ruby on Rails coding. This baseline setup is what we use for our LearningRails online course.</summary>
    <content type="html">
This guide walks you through setup instructions for preparing a Mac OS X 10.4 (aka Tiger) development machine to be used for general Ruby on Rails coding. This baseline setup is what we use for our "LearningRails online course":/course.

You will end up with a development machine with the following baseline components:

# Ruby and all basic Ruby utilities
# Ruby Gems package manager
# Subversion client
# Git client
# Native development tools (Xcode, C compiler)
# MacPorts native code package manager
# MySQL database client utilities and server
# Gems for Ruby on Rails, Capistrano, Mongrel, Mongrel Cluster, and MySQL
# Programmer's editor or IDE

Note: In the command sequences we illustrate here, command line prompts are shown as a dollar sign (@$@).

h2. Prerequisites

This guide assumes you have a Macintosh computer running the current Tiger operating system with up-to-date System Update patches applied. It also assumes you have not set up alternate Ruby on Rails tools prior to running through this guide. If you have, then small adjustments may be required as you walk through the following instructions.

You will need to have access to an Internet connection to complete various download steps. 

You will need to have administrator access to your computer to complete this guide. We will be using the @sudo@ command to run various command line programs and some of the Mac OS X native installers will also ask you for your password.

It is helpful if you have access to your operating system installation discs.

h2. The Recipe

Follow this recipe in sequence. If you have previously installed a particular component, you can usually skip the associated step.

If you are planning on upgrading to Mac OS X 10.5 (Leopard), you should do so now and save some time setting up the Ruby environment. "Leopard comes with a current version of Ruby and it makes setting things up much easier":http://www.buildingwebapps.com/articles/17-setting-up-rails-on-leopard-mac. If you follow this guide and then upgrade to Leopard later, it is pretty simple to deactivate (or remove) the redundant components that are no longer needed.

h3. Native Development Tools (X11 and Xcode 2.5)

MacPorts will use native development tools when installing many of the utilities listed in this guide. You will also need a native compiler to build many of the gems' native libraries you are going to use. Apple provides a free native compiler tool set called Xcode. If you have your Tiger installation DVD, load it now. If you don't have an installation DVD, you can download the "Xcode 2.5 tools at Apple's Developer Web Site":http://developer.apple.com/tools/download/. (Note: Apple developer accounts are free.)

Open the @Xcode Tools@ folder (or DMG file if you downloaded the package). Double click on the @XcodeTools.mpkg@ installer and select a standard install. This will take a few minutes to run:

!/assets/installmac104_xcode.jpg!

As an optional step, some tools require that the X11 window manager application be installed. Under Tiger, this is an optional install. You can find X11 on your Tiger installation DVD or "download it from Apple":http://www.apple.com/downloads/macosx/apple/macosx_updates/x11update2006113.html.

h3. MacPorts

"MacPorts":http://www.macports.org/ is a native code package manager for Macintosh software. This guide uses MacPorts to setup the Ruby tools, MySQL, and the Git distributed version control system. There are many other tools available in the MacPorts library, so it is well worth checking out.

Download the "Tiger Universal version":http://svn.macports.org/repository/macports/downloads/MacPorts-1.6.0/MacPorts-1.6.0-10.4-Tiger.dmg (1.6.0 at the time of this writing) and double click the MacPorts DMG file to open it up. Double click on "MacPorts-1.6.0.pkg" to start the installer and select the default options.

!/assets/installmac104_ports.jpg!

After MacPorts completes installation, you need to adjust your command line @PATH@ environment variable so you can run the @port@ command.

Fire up the Terminal program and enter the command:

&lt;pre&gt;
	$ open .bash_profile
&lt;/pre&gt; 

Note that there is a period in front of "bash_profile". The bash shell configuration file should open in the TextEdit program.  If you don't have a .bash_profile, you can create a new one in your text editor and save it in your home directory.

(By the way, we recommend "iTerm":http://iterm.sourceforge.net/ as a nice open source replacement to the Apple Terminal program.)

Inside of .bash_profile, find the line that starts with @export PATH=@, if present. You are going to insert the new directories used by MacPorts into your path:

&lt;pre&gt;
	export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
&lt;/pre&gt;

If you don't have a line that exports your PATH, use the text exactly as above. If you do already have such a line, add the @/opt/local/bin:/opt/local/sbin:@ (note colons) after the first quote, but before any other paths. Here is an example:

&lt;pre&gt;
	export PATH="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:$PATH"
&lt;/pre&gt;

Save the file and close TextEdit. Open a new terminal window and have MacPorts update itself with the command:

&lt;pre&gt;
	$ sudo port selfupdate
&lt;/pre&gt;

h3. Ruby and Ruby Utilities (irb, ri, rdoc)

Tiger comes pre-installed with a version of Ruby that is out of date for day to day use. You will use MacPorts to upgrade to the latest production version of the Ruby toolset. In a terminal window type:

&lt;pre&gt;
	$ sudo port install ruby
	Password:
	---&gt;  Fetching ncursesw
	---&gt;  Attempting to fetch ncurses-5.6.tar.gz from http://ftp.gnu.org/gnu/ncurses
	---&gt;  Verifying checksum(s) for ncursesw
	---&gt;  Extracting ncursesw
	---&gt;  Applying patches to ncursesw
	---&gt;  Configuring ncursesw
	---&gt;  Building ncursesw with target all
	---&gt;  Staging ncursesw into destroot
...
	---&gt;  Installing ncurses 5.6_0+darwin_8
	---&gt;  Activating ncurses 5.6_0+darwin_8
	---&gt;  Cleaning ncurses
	---&gt;  Fetching openssl
	---&gt;  Attempting to fetch openssl-0.9.8e.tar.gz from http://www.openssl.org/source/
...
	---&gt;  Fetching ruby
	---&gt;  Attempting to fetch ruby-1.8.6.tar.gz from http://www.ibiblio.org/pub/languages/ruby/1.8
	---&gt;  Attempting to fetch ruby-1.8.6.tar.gz from http://mirrors.sunsite.dk/ruby/1.8
	---&gt;  Verifying checksum(s) for ruby
	---&gt;  Extracting ruby
	---&gt;  Applying patches to ruby
	---&gt;  Configuring ruby
	---&gt;  Building ruby with target all
	---&gt;  Staging ruby into destroot
	---&gt;  Packaging tgz archive for ruby 1.8.6_0+thread_hooks
	---&gt;  Installing ruby 1.8.6_0+thread_hooks
	---&gt;  Activating ruby 1.8.6_0+thread_hooks
	---&gt;  Cleaning ruby
&lt;/pre&gt;

Your output may be slightly different depending on the versions of software at the time you run these commands. The listing here was edited for brevity.

You can check that Ruby is installed with:

&lt;pre&gt;
	$ which ruby
	/opt/local/bin/ruby
	$ ruby -v
	ruby 1.8.6 (2007-03-13 patchlevel 0) [powerpc-darwin8.11]
&lt;/pre&gt;

You should seem similar responses. The important one is the first one which reports back the path of the program. If you are using the MacPorts Ruby, it will be located in @/opt/local/bin/@.

h3. Ruby Gems Package Manager

You next need to install the latest version of @gem@. 

&lt;pre&gt;
	$ sudo port install rb-rubygems rb-termios
&lt;/pre&gt;

Check the version that gets installed:

&lt;pre&gt;
	$ gem -v
	0.9.4
&lt;/pre&gt;

You need 1.0.1 or newer. If you have an older version, you can update with the command line: @sudo gem update --system@.

h3. Installing a Subversion client

Subversion will be used to access your source code repository during development and deployments. You will need a current version of the Subversion client and you can use MacPorts to install it:

&lt;pre&gt;
	$ sudo port install subversion +tools
&lt;/pre&gt;

h3. Installing Git via MacPorts

Git is all the rage in the Rails world now and has pretty much replaced Subversion as the version control system of choice. That said, both are in common use. Currently Leopard doesn't install git by default, so we'll use MacPorts to quickly install git:

&lt;pre&gt;
 	$ sudo port install git-core +doc +svn
&lt;/pre&gt;

This command installs the core git tools, the man page documentation, and integration with Subversion. This last is useful if you plan on migrating from or need to work with a legacy Subversion repository. The installation will take a while; it has a lot to load.

Besides your own project version control, you'll typically use git when loading Rails 2.1 and various 3rd party plugins.

h3. Installing MySQL via MacPorts

By leveraging MacPorts to install MySQL, maintenance of the software is slightly easier, especially when you want to upgrade over time. We are using MySQL on our development machine as we prefer to have identical software across our environments. Rails 2.0.2, 2.1, and newer uses SQLite by default, which is fine for development and experimentation, but not appropriate for production code.

To get started, type into your terminal window:

&lt;pre&gt;
	$ sudo port install mysql5 +server
&lt;/pre&gt;

This command downloads and installs the baseline MySQL client programs and server software. Next, you want to configure MySQL's server so it launches when your computer boots up:

&lt;pre&gt;
	$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
&lt;/pre&gt;

@launchctl@ is an Apple tool that administers the system daemon that controls the boot process and background programs. Here you are loading the instructions for how to manage MySQL.

A fresh MySQL installation requires its database storage area to be initialized, so you do that next:

&lt;pre&gt;
	$ sudo mysql_install_db5 --user=mysql
&lt;/pre&gt;

When you configure the storage area with this command, you're making sure it is owned by the user "mysql".

MySQL creates a special system file used for program to program communication, called the "socket" file. By default, the MacPorts installation of MySQL server creates this in the directory "/opt/local/var/run/mysql5/mysqld.sock". Ruby on Rails applications can deal with this just fine if you change the settings in your database.yml file to include a @socket@ entry that points to the correct place. However, we are going to tweak things so all applications can find the file in a fairly standard place: */tmp/mysql.sock* with little or no modification.

First, you need to move the default configuration file, @my.cnf@, to the correct place:

&lt;pre&gt;
	$ sudo mv /opt/local/etc/my.cnf /opt/local/etc/mysql5/my.cnf
&lt;/pre&gt;

If the installation program didn't put a file into /opt/local/etc/, try this instead:

&lt;pre&gt;
	$ sudo mv /opt/local/share/mysql5/mysql/my-medium.cnf /opt/local/etc/mysql5/my.cnf
&lt;/pre&gt;

Now, you need to edit the configuration file to change where the socket file is stored:

&lt;pre&gt;
	$ sudo pico /opt/local/etc/mysql5/my.cnf
&lt;/pre&gt;

If you aren't familiar with the @pico@ command line editor, we explain the few commands you will need here.

Inside of @pico@, use your arrow keys to move down to the line where you first see "[client]" and make the following changes (this is just a small part of the whole file):

&lt;pre&gt;
	...
	# In this file, you can use all long options that a program supports.
	# If you want to know which options a program supports, run the program
	# with the "--help" option.
	
	[mysqld_safe]
	socket          = /tmp/mysql.sock

	# The following options will be passed to all MySQL clients
	[client]
	#password       = your_password
	port            = 3306
	socket          = /tmp/mysql.sock

	# Here follows entries for some specific programs

	# The MySQL server
	[mysqld]
	port            = 3306
	socket          = /tmp/mysql.sock
	...
&lt;/pre&gt;

You are adding the "[mysqld_safe]" section (2 lines) just above "[client]" and then changing the two instances of the "socket = " lines in the "[client]" and "[mysqld]" sections to be @/tmp/mysql.sock@. Once done, press @Control-X@, answer @Y@ when asked to save, and press return to accept the default file name ("my.cnf").

Now you start the server up manually:

&lt;pre&gt;
	$ cd /opt/local ; sudo /opt/local/lib/mysql5/bin/mysqld_safe &amp;	 
&lt;/pre&gt;

You can confirm that MySQL is running by trying to fire it up:

&lt;pre&gt;
	$ mysql5 -p -u root
	Welcome to the MySQL monitor.  Commands end with ; or \g.
	Your MySQL connection id is 1
	Server version: 5.0.45 Source distribution

	Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

	mysql&gt; exit
&lt;/pre&gt;

When you reboot your computer, MySQL should start automatically in the future.

h3. Gems

Tiger requires that you install the base collection of gems you will be using:

&lt;pre&gt;
	$ sudo gem install rake rails capistrano mongrel mongrel_cluster
&lt;/pre&gt;

All installed gems (including Ruby on Rails and its dependencies, Rake, Capistrano, Mongrel, and Mongrel_Cluster) will get installed at their latest versions.

The MySQL adapter gem needs to be installed, and it is a little finicky due to our use of MacPorts.

If you are running Tiger on an Intel processor, use this command (on one line):

&lt;pre&gt;
	$ ARCHFLAGS="-arch i386" sudo gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5
&lt;/pre&gt;

and if you are on a PowerPC processor, use this command:

&lt;pre&gt;
	ARCHFLAGS="-arch ppc" sudo gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5
&lt;/pre&gt;

Once the command completes, you should be all set with the baseline gems you will need for the LearningRails courses.

h3. Code Editing Tools

While you can get by with using a plain text editor like TextEdit, or even Apples Xcode IDE, you will have much high productivity if you use a programming editor that is highly tuned to Ruby on Rails development.

We use the commercial "TextMate":http://macromates.com/ programmer's editor for much of our day to day work. TextMate is highly extensible through a collection of community supplied "bundles". Many add-ons accelerate development by enhancing the editor (for example, adding language specific short cuts to reduce your typing) or by tying in to other utilities, such as Subversion or Rake, to allow you to quickly get tasks done without leaving the editor's environment.

There are a variety of good open source or free programmer editors available too. On the open source side, Leopard comes pre-installed with both vim and emacs. "jEdit":http://www.jedit.org/ is a very extensible open source editor written in Java. "TextWrangler":http://www.barebones.com/products/textwrangler/ is a free programmer's editor from BareBones.

Whatever editor you choose, be certain that it provides easy navigation among a large number of open files. Working with Rails applications generally involves dealing with a lot of small files, and that process needs to be efficient.

If you prefer an all-in-one tool, you should look at one of several integrated development environments that exist for Ruby. We use "Netbeans":http://www.netbeans.org/ in our LearningRails courses, but you should check out the numerous "other options listed at BuildingWebApps.com":http://www.buildingwebapps.com/topic/26-integrated-development-environments-ides.

    &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=b8wDO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=b8wDO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=mYxNO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=mYxNO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=I59ko"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=I59ko" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/buildingwebappsarticles/~4/345381744" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://buildingwebapps.com/articles/6455-setting-up-rails-on-tiger-mac</feedburner:origLink></entry>
  <entry>
    <title>Setting up Rails on Leopard (Mac OS X 10.5)</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/345381745/6433-setting-up-rails-on-leopard-mac" rel="alternate" />
    <id>http://buildingwebapps.com/articles/6433-setting-up-rails-on-leopard-mac</id>
    <updated>2008-07-19T00:00:00Z</updated>
    <author>
      <name>Christopher Haupt</name>
    </author>
    <summary>This guide walks you through setup instructions for preparing a Mac OS X 10.5 (aka Leopard) development machine to be used for general Ruby on Rails coding. This baseline setup is what we use for our LearningRails online course.</summary>
    <content type="html">
This guide walks you through setup instructions for preparing a Mac OS X 10.5 (aka Leopard) development machine to be used for general Ruby on Rails coding. This baseline setup is what we use for our "LearningRails online course":/course.

You will end up with a development machine with the following baseline components:

# Ruby and all basic Ruby utilities
# Ruby Gems package manager
# Subversion client
# Git client
# Native development tools (Xcode, C compiler)
# MacPorts native code package manager
# MySQL database client utilities and server
# Gems for Ruby on Rails, Capistrano, Mongrel, Mongrel Cluster, and MySQL
# Programmer's editor or IDE

Note: In the command sequences we illustrate here, command line prompts are shown as a dollar sign (@$@).

h2. Prerequisites

This guide assumes you have a Macintosh computer running the current Leopard operating system with up-to-date System Update patches applied. It also assumes you have not set up alternate Ruby on Rails tools prior to running through this guide. If you have, then small adjustments may be required as you walk through the following instructions.

You will need to have access to an Internet connection to complete various download steps. 

You will need to have administrator access to your computer to complete this guide. We will be using the @sudo@ command to run various command line programs and some of the Mac OS X native installers will also ask you for your password.

It is helpful if you have access to your operating system installation discs.

h2. The Recipe

Follow this recipe in sequence. If you have previously installed a particular component, you can usually skip the associated step.

h3. Ruby and Ruby Utilities (irb, ri, rdoc)

Leopard comes pre-installed with Ruby 1.8.6 and its associated utilities. You can use these programs as is. To check them out, open a Terminal window and type:

&lt;pre&gt;
	$ which ruby
	/usr/bin/ruby
	$ ruby -v
	ruby 1.8.6 (2007-09-24 patchlevel 111) [universal-darwin9.0]
&lt;/pre&gt;

You should seem similar responses. The important one is the first one which reports back the path of the Ruby interpreter program. If you are using the built-in Ruby, it will be located in @/usr/bin/@.

h3. Ruby Gems Package Manager

Leopard comes with a pre-installed version of @gem@. Be sure you have the latest version:

&lt;pre&gt;
	$ gem -v
	1.0.1
&lt;/pre&gt;

You need 1.0.1 or newer. If you have an older version, you can update with the command line: @sudo gem update --system@.

h3. Native Development Tools (Xcode 3.0)

You will need a native compiler to build many of the gems' native libraries you are going to use. You will also occasionally build other native tools via the MacPorts tool described below. Apple provides a free native compiler tool set called Xcode. If you have your Leopard installation DVD, load it now. If you don't have an installation DVD, you can download the "Xcode 3.0 tools at Apple's Developer Web Site":http://developer.apple.com/tools/download/. (Note: Apple developer accounts are free.)

Open the @Optional Installs@ folder, and then the @Xcode Tools@ folder. Double click on the @XcodeTools.mpkg@ installer and select a standard install. This will take a few minutes to run:

!/assets/installmac105_xcode.jpg!

h3. MacPorts

"MacPorts":http://www.macports.org/ is a native code package manager for Macintosh software. This guide uses MacPorts to setup an installation of MySQL and the Git distributed version control system. There are many other tools available in the MacPorts library, so it is well worth checking out.

Download the "Leopard Universal version":http://svn.macports.org/repository/macports/downloads/MacPorts-1.6.0/MacPorts-1.6.0-10.5-Leopard.dmg (1.6.0 at the time of this writing) and double click the MacPorts DMG file to open it up. Double click on "MacPorts-1.6.0.pkg" to start the installer and select the default options.

!/assets/installmac105_ports.jpg!

After MacPorts completes installation, you need to adjust your command line @PATH@ environment variable so you can run the @port@ command.

Fire up the Terminal program and enter the command:

&lt;pre&gt;
	$ open .bash_profile
&lt;/pre&gt; 

Note that there is a period in front of "bash_profile". The bash shell configuration file should open in the TextEdit program. If you don't have a .bash_profile, you can create a new one in your text editor and save it in your home directory.

(By the way, we recommend "iTerm":http://iterm.sourceforge.net/ as a nice open source replacement for the Apple Terminal program.)

Inside of .bash_profile, find the line that starts with @export PATH=@, if present. You are going to insert the new directories used by MacPorts into your path:

&lt;pre&gt;
	export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
&lt;/pre&gt;

If you don't have a line that exports your PATH, use the text exactly as above. If you do already have such a line, add the @/opt/local/bin:/opt/local/sbin:@ (note colons) after the first quote, but before any other paths. Here is an example:

&lt;pre&gt;
	export PATH="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:$PATH"
&lt;/pre&gt;

Save the file and close TextEdit. Open a new terminal window and have MacPorts update itself with the command:

&lt;pre&gt;
	$ sudo port selfupdate
&lt;/pre&gt;

h3. Installing Git via MacPorts

Git is all the rage in the Rails world now and has pretty much replaced Subversion as the version control system of choice. That said, both are in common use. Currently Leopard doesn't install git by default, so we'll use MacPorts to quickly install git:

&lt;pre&gt;
 	$ sudo port install git-core +doc +svn
&lt;/pre&gt;

This command installs the core git tools, the man page documentation, and integration with Subversion. This last is useful if you plan on migrating from or need to work with a legacy Subversion repository. The installation will take a while; it has a lot to load.

Besides your own project version control, you'll typically use git when loading Rails 2.1 and various 3rd party plugins.

h3. Installing MySQL via MacPorts

By leveraging MacPorts to install MySQL, maintenance of the software is slightly easier, especially when you want to upgrade over time. We are using MySQL on our development machine as we prefer to have identical software across our environments. Rails 2.0.2, 2.1 and newer uses SQLite by default, which is fine for development and experimentation, but not appropriate for production code.

To get started, type into your terminal window:

&lt;pre&gt;
	$ sudo port install mysql5 +server
&lt;/pre&gt;

This command downloads and installs the baseline MySQL client programs and server software. Next, you want to configure MySQL's server so it launches when your computer boots up:

&lt;pre&gt;
	$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
&lt;/pre&gt;

@launchctl@ is an Apple tool that administers the system daemon that controls the boot process and background programs. Here you are loading the instructions for how to manage MySQL.

A fresh MySQL installation requires its database storage area to be initialized, so you do that next:

&lt;pre&gt;
	$ sudo mysql_install_db5 --user=mysql
&lt;/pre&gt;

When you configure the storage area with this command, you're making sure it is owned by the user "mysql".

MySQL creates a special system file used for program to program communication, called the "socket" file. By default, the MacPorts installation of MySQL server creates this in the directory "/opt/local/var/run/mysql5/mysqld.sock". Ruby on Rails applications can deal with this just fine if you change the settings in your database.yml file to include a @socket@ entry that points to the correct place. However, we are going to tweak things so all applications can find the file in a fairly standard place: */tmp/mysql.sock* with little or no modification.

First, you need to move the default configuration file, @my.cnf@, to the correct place:

&lt;pre&gt;
	$ sudo mv /opt/local/etc/my.cnf /opt/local/etc/mysql5/my.cnf
&lt;/pre&gt;

If the installation program didn't put a file into /opt/local/etc/, try this instead:

&lt;pre&gt;
	$ sudo mv /opt/local/share/mysql5/mysql/my-medium.cnf /opt/local/etc/mysql5/my.cnf
&lt;/pre&gt;

Now, you need to edit the configuration file to change where the socket file is stored:

&lt;pre&gt;
	$ sudo pico /opt/local/etc/mysql5/my.cnf
&lt;/pre&gt;

If you aren't familiar with the @pico@ command line editor, we explain the few commands you will need here.

Inside of @pico@, use your arrow keys to move down to the line where you first see "[client]" and make the following changes (this is just a small part of the whole file):

&lt;pre&gt;
	...
	# In this file, you can use all long options that a program supports.
	# If you want to know which options a program supports, run the program
	# with the "--help" option.
	
	[mysqld_safe]
	socket          = /tmp/mysql.sock

	# The following options will be passed to all MySQL clients
	[client]
	#password       = your_password
	port            = 3306
	socket          = /tmp/mysql.sock

	# Here follows entries for some specific programs

	# The MySQL server
	[mysqld]
	port            = 3306
	socket          = /tmp/mysql.sock
	...
&lt;/pre&gt;

You are adding the "[mysqld_safe]" section (2 lines) just above "[client]" and then changing the two instances of the "socket = " lines in the "[client]" and "[mysqld]" sections to be @/tmp/mysql.sock@. Once done, press @Control-X@, answer @Y@ when asked to save, and press return to accept the default file name ("my.cnf").

Now you start the server up manually:

&lt;pre&gt;
	$ cd /opt/local ; sudo /opt/local/lib/mysql5/bin/mysqld_safe &amp;	 
&lt;/pre&gt;

You can confirm that MySQL is running by trying to fire it up:

&lt;pre&gt;
	$ mysql5 -p -u root
	Welcome to the MySQL monitor.  Commands end with ; or \g.
	Your MySQL connection id is 1
	Server version: 5.0.45 Source distribution

	Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

	mysql&gt; exit
&lt;/pre&gt;

When you reboot your computer, MySQL should start automatically in the future.

h3. Gems

Leopard conveniently pre-installs the base collection of gems you will be using, but you need to make sure they are up to date:

&lt;pre&gt;
	$ sudo gem update
&lt;/pre&gt;

All installed gems (including Ruby on Rails and its dependencies, Rake, Capistrano, Mongrel, and Mongrel_Cluster) will get updated.

The MySQL adapter gem needs to be installed, and it is a little finicky due to our use of MacPorts.

If you are running Leopard on an Intel processor, use this command (on one line):

&lt;pre&gt;
	$ ARCHFLAGS="-arch i386" sudo gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5
&lt;/pre&gt;

and if you are on a PowerPC processor, use this command:

&lt;pre&gt;
	ARCHFLAGS="-arch ppc" sudo gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5
&lt;/pre&gt;

Once the command completes, you should be all set with the baseline gems you will need for the LearningRails courses.

h3. Code Editing Tools

While you can get by with using a plain text editor like TextEdit, or even Apple's Xcode IDE, you will be more productive if you use a programming editor that is highly tuned to Ruby on Rails development.

We use the commercial "TextMate":http://macromates.com/ programmer's editor for much of our day-to-day work. TextMate is highly extensible through a collection of community supplied "bundles". Many add-ons accelerate development by enhancing the editor (for example, adding language specific short cuts to reduce your typing) or by tying in to other utilities, such as Subversion or Rake, to allow you to quickly get tasks done without leaving the editor's environment.

There are a variety of good open source or free programmer editors available too. On the open source side, Leopard comes pre-installed with both vim and emacs. "jEdit":http://www.jedit.org/ is a very extensible open source editor written in Java. "TextWrangler":http://www.barebones.com/products/textwrangler/ is a free programmer's editor from BareBones.

Whatever editor you choose, be certain that it provides easy navigation among a large number of open files. Working with Rails applications generally involves dealing with a lot of small files, and that process needs to be efficient.

If you prefer an all-in-one tool, ook at one of the integrated development environments for Ruby. We use "Netbeans":http://www.netbeans.org/ when we aren't using TextMate, but the numerous "other options listed at BuildingWebApps.com":http://www.buildingwebapps.com/topic/26-integrated-development-environments-ides are worth a look.


    &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=paUZO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=paUZO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=IdmuO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=IdmuO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=wSuTo"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=wSuTo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/buildingwebappsarticles/~4/345381745" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://buildingwebapps.com/articles/6433-setting-up-rails-on-leopard-mac</feedburner:origLink></entry>
  <entry>
    <title>Podcasts and Screencasts on Ruby on Rails</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/345381743/6509-podcasts-and-screencasts-on-ruby-on" rel="alternate" />
    <id>http://buildingwebapps.com/articles/6509-podcasts-and-screencasts-on-ruby-on</id>
    <updated>2008-06-18T00:00:00Z</updated>
    <author>
      <name>Michael Slater</name>
    </author>
    <summary>There's a variety of screencasts and podcasts available for Ruby on Rails developers. Here's a quick rundown of the major ones, and how they differ.</summary>
    <content type="html">
There's a variety of screencasts and podcasts available for Ruby on Rails developers. Here's a quick rundown of the major ones, and how they differ. 

h2. Podcasts

Audio podcasts are great for listening on the go, and for things such as news and interviews.

h3. Tutorial: Learning Rails

Our own "Learning Rails":/course series consists of 8 podcasts that cover the fundamental concepts behind Ruby on Rails.

h3. People: Ruby on Rails Podcast

The longest-running podcast in the Rails world is the "official" "Ruby on Rails podcast":http://podcast.rubyonrails.org/, first created by Scott Barron but produced for most of its life by Geoffrey Grosenbach. This is a great series of interviews with many of the leading developers in the Ruby and Rails world.

h3. News: Rails Envy

The "Rails Envy podcast":http://railsenvy.com/podcast comes out every week and provides a fantastic summary of the latest developments in the Rails world. It's put together by Gregg Pollack, Jason Seifer, and Steven Bristol, who diligently track a wide variety of Rails blogs to provide you with a distilled and entertaining weekly update.

h2. Screencasts

Screencasts let you watch what's going on on the screen while the presenter explains what they're doing. It's like looking over the shoulder of a developer while they work. Screencasts are a great teaching tool.

h3. Learning Rails

Our "Learning Rails":/screencasts screencast series shows how to build a simple web site using Ruby on Rails, step-by-step. Designed for people who are new to Ruby on Rails.

h3. Envycasts

"Envycasts":http://envycasts.com is the latest entrant into the Rails screencasts business. They're created by the Rails Envy folks, Gregg Pollack and Jason Seifer, who bring their trademark wit and creative production to advanced technical screencasts. There's nothing else like them. Priced at $9 each.

h3. Railscasts

Ryan Bates has producing more than 100 free "Railscasts":http://railscasts.com screencasts. They're short episodes focused on a single feature of Rails, and are a great way to learn how to do specific things with Rails.

h3. Peepcode

Geoffrey Grosenbach's "Peepcode":http://peepcode.com are the gold standard for Ruby on Rails screencasts. At $9 each, they aren't free, but they're still a great value. They're typically about an hour long and deeply explore specific topics, from Git to rSpec.

h3. Pragmatic Screencasts

The Pragmatic Programmer, well known for their Ruby and Rails books, has teamed with Mike Clark of Pragmatic Studio, a leading provider of Rails training, to produce the "Pragmatic Screencasts":http://pragmatic.tv. The 20 to 30 minutes screencasts cost $5 each. So far, most of them are not about Ruby or Rails, but there is a series by Ryan Bates on "Everyday Active Record."

h3. RubyPlus

Bala Paranj has produce more than 70 free screencasts on various Ruby and Ruby on Rails techniques at "RubyPlus.org":http://rubyplus.org.

h3. Coderpath

Miles K. Forrest recorded a few early Rails screencasts at "coderpath":http://coderpath.com a couple years ago. He's been quiet since, but he's talking about restarting the series.

h3. Zenunit Sensei

A short series of Rails screencasts, free for now with some talk of paid screencasts in the future, at "Zenunit Sensei":http://sensei.zenunit.com/. From Australia, apparently by Julian Leviston.    &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=laG5O"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=laG5O" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=jxv7O"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=jxv7O" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=OAWDo"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=OAWDo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/buildingwebappsarticles/~4/345381743" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://buildingwebapps.com/articles/6509-podcasts-and-screencasts-on-ruby-on</feedburner:origLink></entry>
  <entry>
    <title>The Rebuilding and Scaling of YellowPages.com</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/345381742/6512-the-rebuilding-and-scaling-of-yellowpages-com" rel="alternate" />
    <id>http://buildingwebapps.com/articles/6512-the-rebuilding-and-scaling-of-yellowpages-com</id>
    <updated>2008-06-02T00:00:00Z</updated>
    <author>
      <name>Michael Slater</name>
    </author>
    <summary>John Straw, chief software architect at YellowPages.com, gave an excellent talk at RailsConf about YellowPages' conversion to Rails. John's talk covered the scaling issues, but the talk was just as much about the process of successfully doing a big rewrite of a critical application at a large company.</summary>
    <content type="html">
&lt;div style='float:left; width: 210px'&gt;

!/assets/johnstraw.jpg!

&lt;/div&gt;

John Straw, chief software architect at "YellowPages.com":http://www.yellowpages.com, gave an excellent talk at RailsConf about YellowPages' conversion to Rails. We've pointed to YellowPages in the past as being one of the highest-traffic Rails sites, proving that "Rails can scale":/articles/13-can-rails-scale-absolutely.

John's talk covered the scaling issues, but the talk was just as much about the process of successfully doing a big rewrite of a critical application at a large company. (YellowPages.com is part of AT&amp;T.)

You can "download John's presentation":http://en.oreilly.com/rails2008/public/asset/attachment/2765 from the RailsConf site.

With 2.5M searches per day and more than 170 million page views per month, YellowPages.com is now the biggest site AT&amp;T runs, generating more traffic than att.com.

h2. Why the rewrite?

The previous version was written in Java in 2004 and 2005 by consultants, and had fundamental design problems. This version had 125K lines of code and no automated tests, making new features hard to implement. The Rails version ended up with fewer than 20K lines of code, including tests.

The Java site also had lots of usability issues and SEO problems. As an example of the difficulty of adding features, John noted that it took three months to add a rating feature.

The requirements for the new version included:

* Absolute control of URLs
* No sessions
* Be agile
* Develop easy-to-leverage core business services

The new product was built by a cross-functional team of 20 people, including project managers, user experience experts, advertising people, search experts, and content and community managers. There were never more than 5 developers. The entire team sat together for the duration of the project.

The architecture they designed has three tiers: a web tier that delivers the front-end web experience; a services tier that responds to requests from the web tier; and a search cluster that performs the actual searches.

The team built an initial Rails prototype in early 2007 that looked like the existing site, just to get some experience with Rails. (Only one of the team members had any prior Rails experience.) They also built prototype search code in Python. They then started a new Rails prototype with designs from user experience team. They also built a Django prototype to explore that option, and evaluated EJB3/JBoss as a service tier platform.

h2. Why Rails?

The team rejected Java for the front end in part because of its inadequate URL control. In terms of Rails vs. Django, John called the decision a near toss-up. Platform maturity was an important attribute that led them to choose Rails. They also felt that it had better automated testing integration and a clearer path to moving parts of it to C if necessary for performance. Ultimately, the development team simply felt more comfortable with it.

John had initially expected they would use Java for the service tier, but after an evaluation of EJB3 the team felt there were no real advantages over Ruby or Python for their application. All the reasons for choosing Rails for the web tier applied equally to service tier, and having a single software environment has obvious advantages.

h2. Keeping the project moving

The success of this rewrite had as much to do with adeptly managing the process as with technology. One key to keeping it moving was giving one person decision-making authority. Another important factor was freezing development on the existing site, so they wouldn't have a moving target. An ad-hoc rule they came up with was that if you can't figure out quickly how you'd like to change something about the existing site, then don't change it.

Another important process was early and frequent communication with the sales team. A previous site redesign had nearly failed because of lack of support from sales. The project lead, who came from the user experience team, met with 20 to 40 salespeople a week to review the proposed changes. This gave them the buy-in they needed for the site to be successful from a business perspective.

The site was made available to friends and family as a closed beta on 4/26/07, an open beta on 5/17/07, and then went live at the end of June, less than six months after beginning work on their first Rails prototype. This was the first time AT&amp;T had released a beta of any kind.

A few things were farmed out to other teams, including HTML/CSS coding, rewrite rules for legacy URL translation, and performance evaluation for the production deployment configuration.

h2. System architecture

The web tier, service tier, and search cluster are each fronted by an "F5 load balancer":http://www.f5.com/products/big-ip/. The web tier initially used Apache with 16 Mongrels on each server, while the service tier uses Apache with 30 Mongrels and memcached on each server.

The communication between tiers uses stateless HTTP transactions. The service tier provides a set of RESTful services that return JSON to the web tier. The search cluster uses the "FAST ESP":http://www.fastsearch.com/l3a.aspx?m=1031 search engine.

The entire system consists of 25 machines, each with two dual-core, 64-bit processors. Two of the 25 are used for the database. This compares to 21 servers for the previous Java-based solution. There are two data centers with identical setups; each is designed to handle the entire load, so they provide geographically distributed redundancy.

They run Solaris on the database machines and CentOS 5 on all the others. John called Solaris "a mistake they wouldn't repeat," not because of any particular problems with it but because of a lack of system administrators in their organization who had experience with it.

They use Oracle for the database engine, which had issues with the large numbers of connections created by the large number of Mongrels. As a result, memory usage on the database servers was high, and these machines were upgraded to 12G of RAM.

h2. Performance optimization

The performance goals, which were achieved, were:

* Sub-second home page load time
* 4-second average search time
* Never dies

In the course of performance optimization, they considered "HAProxy":http://haproxy.1wt.eu/ and "Swiftiply":http://swiftiply.swiftcore.org/ but chose to go with the F5 because they had the hardware and understood how to use it.

They wrote Mongrel handlers to pick requests off from the web tier and send them to the service tier without involving Rails. They also wrote a C library for parsing search cluster responses and turning them into hashes.

In the web tier, they switched to "Erubis":http://www.kuwata-lab.com/erubis/ for rendering views. They found asset download times to be a bigger issue than the speed of the framework. Following the Yahoo performance guidelines, they minified the JavaScript. They also switched from Prototype to jQuery.

They used the asset_packager plug-in (now made obsolete by Rails 2) and moved image serving to an "Akamai":http://www.akamai.com/html/solutions/media_delivery.html edge cache.

They found that Apache was slow serving the 42-byte single-pixel GIFs that they use as analytics tags, which drove a shift to "Nginx":/topic/156-nginx for the web tier.

After this tuning, performance was better than the Java site. In terms of availability, all site availability issues in first six months were due to database problems.

All things considered, it was a very successful rewrite. While the problems with the prior Java site cannot all be blamed on the technology, it is clear that Rails gave the team significant advantages with no loss of performance.

    &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=fHTyO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=fHTyO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=JQWcO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=JQWcO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=9vVlo"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=9vVlo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/buildingwebappsarticles/~4/345381742" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://buildingwebapps.com/articles/6512-the-rebuilding-and-scaling-of-yellowpages-com</feedburner:origLink></entry>
  <entry>
    <title>New Crop of Rails 2.0 Books</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/345381741/6508-new-crop-of-rails-2-0-books" rel="alternate" />
    <id>http://buildingwebapps.com/articles/6508-new-crop-of-rails-2-0-books</id>
    <updated>2008-05-29T00:00:00Z</updated>
    <author>
      <name>Michael Slater</name>
    </author>
    <summary>In 2007, more than a dozen Ruby on Rails books debuted &amp;#8212; only to be almost instantly made out-of-date by the release of Rails 2 toward the end of the year. There are now some great Rails 2.0 books out, making life a lot easier for new and experienced Ruby on Rails programmers.</summary>
    <content type="html">
In 2007, more than a dozen Ruby on Rails books debuted -- only to be almost instantly made out-of-date by the release of Rails 2 toward the end of the year. In many respects, books written for Rails 1.2 are usable with Rails 2.0, but they can be problematic. If they use the scaffold generator in their examples, or dynamic scaffolding, the examples simply won't work as written. And there are many small ways, such as the enhanced syntax for migrations, in which a Rails 1.2 book will teach a way that works, but is no longer optimal.

There are now some great Rails 2.0 books out, making life a lot easier for new and experienced Ruby on Rails programmers. Here's a quick rundown of the recent books.

h3. For Beginners

If you're new to Rails and don't have a lot of programming experience, Patrick Lenz's "Simply Rails 2":http://www.amazon.com/exec/obidos/ASIN/0980455200/buildicom-20 provides a great start. It explains all the concepts clearly and doesn't assume much software development background. The example site built throughout the book is a Digg clone, which serves well to illustrate all the key topics.

h3. Getting Started with Rails, for Experienced Developers

If you have some web application and object-oriented programming experience, then you may want a book that goes deeper and explains things more fully, but doesn't take time to explain programming basics. Agile Web Development with Rails, which was for some time the _only_ Rails book, is a great book for developers with some experience.

The second edition of this book, which is the newest available in print, is based on Rails 1.2, and the nicely detailed "Depot" shopping-cart example fails under Rails 2.0. The depth of this book also creates many places where the differences between the versions is significant.

Fortunately, the third edition is now available as a "beta book":http://pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition. You can download today's version as a PDF file, in which most of the critical updates have already been made, which comes with frequent updates, and also pre-order a printed copy so you'll have one as soon it comes out the fall.

h3. Going Deeper

After a slew of tutorial books in 2007, most of which are written for Rails 1.2, there's been a recent surge in deeper, more advanced books that add a tremendous richness to the available Rails books.

"The Rails Way":http://www.amazon.com/exec/obidos/ASIN/0321445619/buildicom-20 is great reference work for Rails developers. It is not a book to start with, but it's one I'd want to have by my side for reference once I had my bearings.

"Advanced Rails Recipes":http://www.amazon.com/exec/obidos/ASIN/0978739221/buildicom-20 includes dozens of short, focused articles explaining how to accomplish a particular Rails task. There's a tremendous amount of accumulated community knowledge in this book, which was written by Mike Clark with contributions from many people in the community.

"Practical REST on Rails 2 Projects":http://www.amazon.com/exec/obidos/ASIN/1590599942/buildicom-20, by Ben Scofield, is the first book to deeply explore the use of RESTful web services as implemented in Rails 2. It even includes an example of a Facebook application.

"Deploying Rails Applications":http://www.amazon.com/exec/obidos/ASIN/0978739205/buildicom-20 is the first book to really tackle Rails deployment in all of its complexities. With a cast of authors that includes Ezra Zygmuntowicz, Bruce Tate, Clinton Begin, Geoffrey Grosenbach, and Brian Hogan, this book encapsulates a lot of hard-earned knowledge and will save a lot of people a lot of pain.
    &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=DbvLO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=DbvLO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=v7aNO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=v7aNO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=D1gHo"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=D1gHo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/buildingwebappsarticles/~4/345381741" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://buildingwebapps.com/articles/6508-new-crop-of-rails-2-0-books</feedburner:origLink></entry>
  <entry>
    <title>Easy Text Formatting with Textile</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/345381740/6399-easy-text-formatting-with-textile" rel="alternate" />
    <id>http://buildingwebapps.com/articles/6399-easy-text-formatting-with-textile</id>
    <updated>2008-05-10T00:00:00Z</updated>
    <author>
      <name>Michael Slater</name>
    </author>
    <summary>HTML is rather verbose as a markup language, and having to include closing tags is messy and error-prone. We're all pretty much stuck with delivering HTML code from our web sites, but that doesn't mean we have to write in it. There are various markup approaches that are superior to HTML when it comes to content creation, and which can be used as source code from which to create HTML. Two that are widely used are ...</summary>
    <content type="html">
When I'm writing content for the web, I hate dealing with HTML coding. HTML is rather verbose as a markup language, and having to include closing tags is messy and error-prone.

We're all pretty much stuck with delivering HTML code from our web sites, but that doesn't mean we have to write in it. There are various markup approaches that are superior to HTML when it comes to content creation, and which can be used as source code from which to create HTML. Two that are widely used are Textile and Markdown.

"Textile":http://textism.com/tools/textile/ was originally developed by Dean Allen for the TextPattern content management system and is now widely used in wikis and blogs. "Markdown":http://daringfireball.net/projects/markdown/basics, created by John Gruber and Aaron Swartz, is an alternative that is conceptually similar but with a different syntax. Many of the popular blog engines provide a choice of Textile or Markdown (or HTML) for posts and comments (this site offers Textile).

In this article, I'll show the basics of Textile markup and how easy it is to use it in Rails applications.

h1. What is Textile?

Textile strives to make text markup as clean and simple as possible. You don't have to put @&lt;p&gt;@ in front of each paragraph; bare text is automatically surrounded by @&lt;p&gt;@ and @&lt;/p&gt;@ tags. To make a first-level heading, just start the line with @h1. @. For example:

&lt;pre&gt;
h1. This is a heading and will be wrapped in &lt;h1&gt; and &lt;/h1&gt; tags

This is a text paragraph and will be wrapped in &lt;p&gt; and &lt;/p&gt; tags.

This is another paragraph.
&lt;/pre&gt;

And I bet you can guess how to make a second-level heading, or a third-level heading.

You never need to use close tags; a pair of carriage returns automatically triggers the appropriate end tag. Quotes are automatically converted to open and close quotes; hyphens are converted to n-dashes (if there is a space on either side); and double hyphens are converted to m-dashes.

To make text bold, surround it with asterisks; to make it italic, with underscores:

&lt;pre&gt;
*This text will render in bold*
_This text will render in italic*
_*This text will render in bold italic*_
&lt;/pre&gt;

To add a link to a piece of text, surround the text in quotes, and follow it by a colon and the URL:

&lt;pre&gt;
"text to be linked":http://thisistheurl.com
&lt;/pre&gt;

To include an image, type its URL surrounded by exclamation points:

&lt;pre&gt;
!http://domain.com/path/to/image.jpg!
&lt;/pre&gt;

To create a bullet list, start each line with an asterisk and a space, like this:

&lt;pre&gt;
* First item
* Second item
* Third item
&lt;/pre&gt;

Want a nested bullet list? Just indent the asterisk by three spaces.

There's more, but this should give you a feel for it. You can also use any HTML you want for things that Textile doesn't cover -- HTML code is simply passed through. For more details, see the "Textile Reference":http://hobix.com/textile/. You can try out Textile online at the "Textile home page":http://www.textism.com/tools/textile/.

h1. Implementing Textile

There are Textile implementations for various environments. In my case, using Ruby on Rails, Textile is implemented by "whytheluckystiff":http://whytheluckystiff.net 's "RedCloth":http://whytheluckystiff.net/ruby/redcloth/ gem. (The current implementation does have some flaws, and a much-enhanced version called "Super RedCloth":http://code.whytheluckystiff.net/redcloth/wiki/SuperRedCloth is in development.) To install, just enter the following in the console:

&lt;pre&gt;
gem install RedCloth
&lt;/pre&gt;

With RedCloth installed, you create a new RedCloth object and pass some Textile-marked-up text to it:

&lt;pre&gt;
textile_styled_text ="h1. This is an example of a heading in Textile"
textile_object = RedCloth.new(textile_styled_text)
&lt;/pre&gt;

Then, when you want to render this as HTML, you simply use:

&lt;pre&gt;
html = textile_object.to_html
&lt;/pre&gt;

h1. Making Textile Even Easier

That's pretty easy, but you can make it even easier. There's a Rails helper "textilize," but thanks to  the "acts_as_textiled":http://errtheblog.com/post/14 plug from Chris Wanstrath, it's even easier than that. Install this plugin:

&lt;pre&gt;
ruby script/plugin install
 svn://errtheblog.com/svn/plugins/acts_as_textiled
&lt;/pre&gt;

And then all you have to do is declare a model attribute as Textile-formatted in your model class:

&lt;pre&gt;
acts_as_textiled  :field_name
&lt;/pre&gt;

That's it -- everything just works! (Remember, though, that you need to restart the server for the model change to take effect.) Textile marked up text is stored in the database. Form fields automatically show unrendered textile. But any other use of the model attribute automatically delivers the rendered HTML instead of the Textile source.

h1. Markup without Coding

You can also simplify the entry of Textile markup by using the "textile_editor_helper":http://slateinfo.blogs.wvu.edu/plugins/textile_editor_helper from Dave Olsen and Chris Scharf. This plug-in renders a set of icons for the common markup tasks in your form view, just above the text entry area:

!/assets/textile_helper.jpg!

When you click an icon, JavaScript code inserts the appropriate markup into your text.

To use this, first install the plugin:

&lt;pre&gt;
ruby script/plugin install
 http://svn.webtest.wvu.edu/repos/rails/plugins/textile_editor_helper

rake textile_editor_helper:install
&lt;/pre&gt;

And then replace the text_area tag in the form in which the user enters the Textile-formatted text with textile_editor:

&lt;pre&gt;
&lt;%= textile_editor 'object', 'field' -%&gt;
&lt;/pre&gt;

textile_editor takes all the same options as text_area.

and at the end of the form add:

&lt;pre&gt;
&lt;%= textile_editor_initialize -%&gt;
&lt;/pre&gt;

Finally, if you don't already include prototype.js, you'll need to add that to your layout:

&lt;pre&gt;
&lt;%= javascript_include_tag 'prototype.js' %&gt;
&lt;/pre&gt;

Presto! Now you have a row of icons above the text area so your users don't have to remember any markup at all. They'll still see the markup in the text area (this is not a wysiwyg editor), which will help them learn the markup code.    &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=CZjHO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=CZjHO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=OtXhO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=OtXhO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=R9aEo"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=R9aEo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/buildingwebappsarticles/~4/345381740" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://buildingwebapps.com/articles/6399-easy-text-formatting-with-textile</feedburner:origLink></entry>
  <entry>
    <title>Web 2.0 Expo Highlights and Factoids</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/345381739/6507-web-2-0-expo-highlights-and-factoids" rel="alternate" />
    <id>http://buildingwebapps.com/articles/6507-web-2-0-expo-highlights-and-factoids</id>
    <updated>2008-04-29T00:00:00Z</updated>
    <author>
      <name>Michael Slater</name>
    </author>
    <summary>Last week's Web 2.0 Expo had an overwhelming amount of content. Like any large conference, the quality was uneven, but there were some great talks and a lot of good ones. Here's some highlights and random factoids about AIM, Ning, WordPress, and MySpace.</summary>
    <content type="html">
Last week's Web 2.0 Expo had an overwhelming amount of content. Like any large conference, the quality was uneven, but there were some great talks and a lot of good ones. Among the main-session talks, "Clay Shirky":http://www.shirky.com/ gave a wonderful talk on the implications of the web. I especially liked his view on the "cognitive surplus" created by the shift from rural to urban lifestyles, and how this has historically been consumed by alcohol, and then by television. Now this cognitive surplus fuels wikipedia, and all the other forms of user participation on the web. Where does the time come from? Just a fraction of the time spent watching television.

* "Video of Clay's talk":http://blip.tv/file/855937.
* "Transcript of Clay's talk":http://www.shirky.com/herecomeseverybody/2008/04/looking-for-the-mouse.html

I'm halfway through his new book, "Here Comes Everybody: The Power of Organizing without Organizations":http://www.amazon.com/exec/obidos/ASIN/1594201536/buildicom-20, and it promises to be a worthwhile read.

The most entertaining talk of the conference, by a long shot, was from "Fake Steve Jobs":http://fakesteve.blogspot.com/, also known as Dan Lyons in his day job at Forbes. The "Secret Diary of Steve Jobs":http://fakesteve.blogspot.com/ is one of the best pieces of technology satire around.

* "Video of Dan's talk at Web 2.0":http://blip.tv/file/858285.

"Videos of all the other keynote presentations":http://web2expo.blip.tv/#864781 are also available.

Among the most technical talks, and the only one with any real Ruby on Rails content, was Gregg Pollack's excellent talk on "The Art of Testing Web Applications":http://www.railsenvy.com/ArtOfTestingWebApplications.pdf. (We proposed several Rails-related talks, but they didn't make the cut; apparently the organizers chose to avoid most technology-specific talks this year.)

Many of the "presentation files":http://en.oreilly.com/webexsf2008/public/schedule/proceedings have been posted, and more are likely to be added soon. 

Here's an assortment of random factoids from my notes:

* 70% of "current.com":http://current.com users are on their computer at the same time they're watching TV
* There's 2.43 billion photos on "flickr":http://flickr.com
* 28 million people a month share a video on "YouTube":http://youtube.com
* MySQL is downloaded 70,000 times a day

* "AIM":http://aim.com stats:
** Delivers 2 billion instant messages every day
** Has had as many as 14 million simultaneous users
** AIM sees a usage drop when there's a popular show on TV, and then a peak when it ends

* "Ning":http://ning.com stats:
** Ning has about 250,000 individual social networks
** 70% of the networks are active (used in last 30 days)
** Adding 1 million registered users per month
** Adding 1,500 new networks a day

* "MySpace":http://myspace.com stats:
** 117M unique users last month
** 100 billion rows of data in the database
** 85 gigs of bandwidth
** 5 million concurrent users
** 200K to 400K new users per day
** 11% of all on-line minutes are spent on myspace
** 50 million messages sent per day

* "WordPress":http://wordpress.com stats:
** 54 million unique visitors in the U.S. each month -- one in four people
** 99.999% of WordPress blogs receive under 10,000 pageviews a day
** In aggregate, there are 10+ million pageviews a day to permalink pages (45% of traffic)
** An amount of content equivalent to 1.5 wikipedias is created on WordPress each month





    &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=iwPaO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=iwPaO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=yyr3O"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=yyr3O" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=KcWto"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=KcWto" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/buildingwebappsarticles/~4/345381739" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://buildingwebapps.com/articles/6507-web-2-0-expo-highlights-and-factoids</feedburner:origLink></entry>
  <entry>
    <title>Tim Bray: Ruby is the Leading Language for Web Applications</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/345381737/6505-tim-bray-ruby-is-the-leading" rel="alternate" />
    <id>http://buildingwebapps.com/articles/6505-tim-bray-ruby-is-the-leading</id>
    <updated>2008-04-25T00:00:00Z</updated>
    <author>
      <name>Michael Slater</name>
    </author>
    <summary>In his keynote talk at the recent Silicon Valley Ruby Conference, Sun's Tim Bray asserted that "PHP and Ruby are the languages of choice for new web apps." Coming from most people, this wouldn't be a remarkable comment, but given that Tim is Sun's director of web technologies, it is worthy of note.</summary>
    <content type="html">
&lt;div style='float:left; width:210px'&gt;

!/assets/tim_bray.jpg!

&lt;/div&gt;

In his keynote talk at the recent Silicon Valley Ruby Conference, Sun's "Tim Bray":http://www.tbray.org/ongoing/misc/Tim asserted that *"PHP and Ruby are the languages of choice for new web apps."* Coming from most people, this wouldn't be a remarkable comment, but given that Tim is Sun's director of web technologies, it is worthy of note. Java wasn't even on Tim's list, much less his recommended solution.

Tim raised two major concerns about PHP: security and maintainability. He also pointed out that the object-oriented features "seem bolted on," and don't feel right as compared to Ruby. He did note that there are some great PHP applications, such as "MediaWiki":http://www.mediawiki.org, "WordPress":http://wordpress.com/, and "Drupal":http://drupal.org.

Tim asserted that Rails is ahead of Java in terms of maintainability because you have so much less code. And, of course, Rails is best for time to market, which can be all-important to the success of a project.

As for when to avoid Rails, Tim cited these situations:

* If the IT group will only deploy Java or .NET
* When you need a lot of experienced developers quickly
* If you have a complex database schema you don't control
* For an application that does a lot of computation

Tim asserted that "waterfall development just doesn't work any more." Some principles for success he cited:

* Be human
* Update often
* Link
* Don't try to be sticky
* Look good
* Balance hubris and humility
* Free the conversation
    &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=DnYGO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=DnYGO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=Zg4jO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=Zg4jO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=tBBdo"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=tBBdo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/buildingwebappsarticles/~4/345381737" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://buildingwebapps.com/articles/6505-tim-bray-ruby-is-the-leading</feedburner:origLink></entry>
  <entry>
    <title>Future of Web Apps Miami 2008</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/345381757/6432-future-of-web-apps-miami-2008" rel="alternate" />
    <id>http://buildingwebapps.com/articles/6432-future-of-web-apps-miami-2008</id>
    <updated>2008-04-23T00:00:00Z</updated>
    <author>
      <name>Christopher Haupt</name>
    </author>
    <summary>Carsonified's Future of Web Apps, Miami, was held February 29th, 2008 at the Miami Carnival Performing Arts Center. FOWA brings together a who's who of Web 2.0 technorati to tackle general themes of interest revolving around where the Web is going. Getting inside thoughts from many of those who have made Web 2.0 successful is interesting, but even better is the discussion that goes on outside of the talks in the hall-ways.</summary>
    <content type="html">
&lt;div style='float:left; width:400px; margin: 0 10px 5px 0'&gt;

!/assets/fowamiami.jpg!

&lt;/div&gt;

Carsonified's _Future of Web Apps_, Miami, was held February 29th, 2008 at the Miami Carnival Performing Arts Center (actually, there were tutorials the day before, and a beach party the following day, but I missed those events).

Future of Web Apps, or FOWA for short, has been held before in London and San Francisco, and this was the first time it was held on the East Coast. FOWA brings together a who's who of Web 2.0 technorati to tackle general themes of interest revolving around where the Web is going. Ryan Carson, chief of Carsonified, lays out those themes and his guests tackle them in a series of talks. Getting inside thoughts from many of those who have made Web 2.0 successful is interesting, but even better is the discussion that goes on outside of the talks in the hall-ways. I found these to be inspiring and reaffirming of many of the practices, ideas, and goals we have with "BuildingWebApps.com":http://buildingwebapps.com/ and beyond.

In Miami, Carson's big themes were Iteration, Speed, and Openness. In many ways, the talks boiled these themes down to the sound byte of "get something out there quickly, small and simple, wash, rinse, repeat (and throw in an API to 'set the data free')".

I'll try to capture some highlights. From a developer point of view, the sessions were generally, well, general, so those looking for deep technical insight probably didn't find it in the single session track. From a _"meet some of Web 2.0's current active drivers"_ viewpoint, it was a good place to mingle.

h2. Kathy Sierra: Creating Passionate Users

"Kathy Sierra":http://headrush.typepad.com/, the keynote speaker, I recalled from her days in the game development world. She addressed the general question "Why are we here?" (meaning, "we" the audience). She proceeded to tackle a variety areas that should concern the audience in "the future," all centering around the idea that what "we" should be doing is creating passionate users (of our products indirectly, most specifically of what users can do with our products, and what they can do with one-another). Ultimately, her point was that we should facilitate users getting together offline as well as on, and use our understanding of "meet"-space (my pun intended) to key in on important behavioral motivators.

Sierra is a strong advocate of enabling users to "kick ass", and touched on how to create "hi-rez" user experiences that get people quickly above the "suck threshold" and nearing the "passion threshold". She reminded the audience that it isn't about the tools we create, but how the tools are used. Driving toward a "telepathy-driven design" mentality, in which the user experience becomes one of "it's as if the app could read my mind" is one goal. 

Overall, Sierra's talk was inspirational in keeping focused on the user, and keeping the user engaged, happy, and successful.


h2. Matt Mullenweg: The Architecture of WordPress
 
Matt Mullenweg of "Automattic":http://automattic.com/ (makers of "WordPress":http://wordpress.com/, "Akismet":http://akismet.com/, and more) highlighted his thoughts on scaling from multiple angles (platforms, business, community, and teams). This was a wide ranging talk, of which there were a few technical tidbits.

WordPress has continued to see high growth over the last six months, but amazingly operates on a relatively small numbers of servers. Mullenweg broke down one WordPress configuration as:

# Two load-balancing machines, running the "Pound":http://www.apsis.ch/pound/ load balancer, "Whackamole":http://www.backhand.org/wackamole/ virtual IP manager, and "Spread":http://www.spread.org/ messaging toolkit
# Two hefty database servers running MySQL
# Three web servers using a well-configured Apache setup

WordPress makes heavy use of its "hyperdb":http://2007.wordcamp.org/schedule/hyperdb-and-performance technology, puts everything into Subversion that does onto a server (all configuration and OS files), keeps things stateless, and uses a lot of "memcached":http://www.danga.com/memcached/.

Mullenweg touched on scaling community and talks more about it "on his blog":http://ma.tt/about/.

With regards to scaling the business, he indicated that their attempts to have subscription levels didn't work so well, particularly since most of their growth was on the side of readers, not bloggers. They ended up going with a specialized advertising model that only shows ads to specific users when visiting permanent pages, or if the user only occasionally views the site. Interestingly, in a show of favoritism to FireFox users, they never show ads to users of FF.

Mullenweg finished with some tips of how he is scaling the team and the five things he looks for when hiring: 1) passion for the space; 2) personality fit; 3) ability to learn (curiosity);  4) familiarity with technologies; and 5) taste.

h2. Tantek Celik, Brian Oberkirch, and Joseph Smarr: The Future of Social Networks

Celik, Oberkirch, and Smarr gave a set of interconnected talks around some of the core building blocks for the next wave of social applications. In the large, these were "RSS":http://cyber.law.harvard.edu/rss/rss.html, "Creative Commons":http://creativecommons.org/ licensed content, "OpenID":http://wiki.openid.net/Main_Page, and "oAuth":http://oauth.net/. Together, it is possible to tie together many interaction modes, across a variety of services such as email, Twitter, Flickr, last.fm, or other specific Social Networks.

Of particular interest to those creating sites that create/use user profile information, Celik gave a nice primer on sharing profile information through the "hCard microformats":http://microformats.org/wiki/hcard-supporting-user-profiles work he has spearheaded. If you aren't familiar with the "microformats":http://microformats.org/about/ efforts, this is definitely something worth checking out.

Profile information can be tied together via "hCard":http://microformats.org/wiki/hcard (which describes "people" information), "XHTML Friends Network (XFN)":http://www.gmpg.org/xfn/ (which covers "relationship" information), and linking profiles' information together across the net using XFN's @rel me="me"@ attribute on your links. This is called "profile equivalency":http://gmpg.org/xfn/and/ and Google's crawlers, among others, use these to build the the data for the "OpenSocial Social Graph API":http://code.google.com/apis/opensocial/.

h2. Key Lessons

A variety of speakers shared key lessons they learned as they built their products, and these lessons drive how they see "the future." Here are some highlights:

Blaine Cook, from "Twitter":http://twitter.com/, emphasized the need to simplify ("YAGNI":http://c2.com/xp/YouArentGonnaNeedIt.html) and listen to users versus your developers, and encouraged everyone to check out their Ruby distributed queue server "Starling":http://rubyforge.org/projects/starling/.

Leah Culver from "Pownce":http://pownce.com/ shared some of the missteps they made introducing their APIs. Their first API was not well conceived, didn't provide access to enough data, and just didn't succeed with developers. For 2.0, they are spending time with developers, greatly opening up the data available to applications, permitting key data uploads (file transfers, note posting, etc.), supporting oAuth, and providing a "developer showcase":http://pownce.com/tools/. Culver indicated that all of these efforts are also in support of the interoperability and key building blocks discussed earlier.

Emily Boyd from "Remember the Milk":http://www.rememberthemilk.com/ gave a really great talk on the evolution if her To Do List service and the amazing amount of work two people can do who are passionate about a space. She is a fun example of a computer person adopting "cool" technologies or "workarounds," "because they are cool," and in this case, doing so at the benefit of her customers. One example was in pushing as much into client-side Javascript processing as possible, adopting Google's "Gears":http://gears.google.com/ offline framework. Another novel feature was unofficial integration of task management with GMail (where no real API exists) through the use of the likes of "greasemonkey":https://addons.mozilla.org/en-US/firefox/addon/748.

Cal Henderson of "Flickr":http://www.flickr.com/ gave one of his trademark talks, equal parts informative and good fun. At FOWA, Henderson focused on automation, monitoring, and incrementalism. At Flickr, they keep releases small and rapid, thereby keeping the amount that can go wrong as small as possible. His book, "Building Scalable Web Sites":http://www.amazon.com/exec/obidos/ASIN/0596102356/buildicom-20 covers many of these techniques and suggestions.

Gary Vaynerchuck of "wine library tv":http://tv.winelibrary.com/ rounded out the day with his inspirational talk. He talked of the creation of his vlog, but most importantly, about the need to be passionate about your community (and wine!).

h2. Worth it?

Overall, FOWA was a great opportunity to meet and greet many of the folks driving current Web 2.0 darlings, as well as mingle and share ideas with other entrepreneurs trying to create the next wave. I'd recommend it if you are looking for events to add to your list of "networking" events, but skip it if you are looking for purely technical information (for that, "barcamp is a better choice than FOWA":http://www.buildingwebapps.com/articles/15-barcamp-miami-2008).

h2. Resources

Many of the talks are available "online as MP3 and slides":http://www.futureofwebapps.com/2008/miami/pastevents.php

Following and contributing to real-time chatter on Twitter at conferences, other events, and topics is much easier with twitter #tag, add "hashtags":http://hashtags.org/ bot to enable it.

    &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=lfQKO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=lfQKO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=jOSzO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=jOSzO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=tZvHo"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=tZvHo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/buildingwebappsarticles/~4/345381757" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://buildingwebapps.com/articles/6432-future-of-web-apps-miami-2008</feedburner:origLink></entry>
  <entry>
    <title>Remote Linux Admin for Windows Users</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/345381764/6398-remote-linux-admin-for-windows-users" rel="alternate" />
    <id>http://buildingwebapps.com/articles/6398-remote-linux-admin-for-windows-users</id>
    <updated>2008-04-23T00:00:00Z</updated>
    <author>
      <name>Michael Slater</name>
    </author>
    <summary>A lot of the remote server administration information on the web assumes that you're on either a Mac or a Linux box. This assumption can add challenges for Windows users, but there are tools available to make Windows do most everything a Linux system does.</summary>
    <content type="html">
All the cool kids in the web world these days seem to be using Macs, which have hearts of Unix so are natural complements to Linux-based servers. Others are running Linux desktops. So a lot of the remote server administration information on the web assumes that you're on either a Mac or a Linux box.

For historical reasons, however, I have a collection of Windows systems, and they're what I'm comfortable with. I also have some things, like my collection of 60,000 photos managed in the Photoshop Elements Organizer, that aren't easily moved to a Mac, and I have lots of Windows applications that I own and am familiar with. So while I don't have any religious feelings about it (please, spare me the Mac evangelism), I'm using Windows systems to remotely administer my web servers.

This really isn't a problem, as there are ample tools available to make Windows do most everything a Linux system does, or a least everything you need to do to administer one remotely. But it does take a little more effort, at times, to track down the right tools and figure out how to apply them. If you're early in this process, this article may help. (If, on the other hand, you're a grey-beard Linux hacker or a Mac die-hard, you can stop reading now.)

Although there are GUI interfaces for Linux, remote administration is done predominantly from the command line. And if you want to follow the well-greased paths for deploying Rails applications, you're going to be living in a command-line world. This is, of course, rather alien in the Windows environment.

There's really two command-line environments you need to use: the Windows command shell,  for taking actions on your local machine, and a Linux shell, for interacting directly with your server. The Windows shell is essentially a grown-up version of the old DOS prompt. Linux shells come in a variety of versions, with BASH being the most common.

h1. Enhancing the Windows Command Window

You need to use the Windows shell to control your local development environment, and with some extensions (to be described in a later post), you can use it for some tasks that involve your remote server as well.

To open a Windows command shell, you can select Run from Start menu and then enter cmd and click OK. But there's a better way: Microsoft offers a free add-on that lets you open a command window by right-clicking on any folder and choosing a new option that the add-on installs, "Open Command Window Here." Aside from being quicker than the Start &gt; Run &gt; cmd approach, it opens the command window with the current directory set to the folder upon which you right clicked. "Download the command window PowerToy":http://download.microsoft.com/download/whistler/Install/2/WXP/EN-US/CmdHerePowertoySetup.exe. It is entirely painless and will make your life just a little bit simpler.

Now you should customize your command window settings, as the defaults are pathetic. The window has no menu, so it may not be immediately clear how one customizes it. The secret is to open any command window, right-click on the title bar, and choose Properties. Once in the properties dialog, here's some things you might want to change:

* In the Options tab, check the boxes to enable Quick Edit Mode and Insert Mode. This enables you to cut and paste text (you can't use ctrl-X and ctrl-V like you can in a GUI environment). To copy, select the text and then click the right mouse button. To paste, just click the right mouse button.
* Also in the Options tab, change the Buffer Size to 999, and the Number of Buffers to 5. This gives you more memory for past commands. At any command prompt, press the up arrow repeatedly to move back through previous commands. This can save a lot of typing.
* In the Layout tab, increase the Screen Buffer Height to 2500, so you'll have more text you can scroll back through after it scrolls off the top of the window. Increase the Screen Height to provide a window as tall as you'd like; I prefer 75 for my 1200-pixel-high monitors.
* In the Colors tab, change the text and background colors if you'd like. White text on a black background is traditional and has a retro appeal, but I prefer black text on a white background.

When you're done making changes, click OK, and then choose Save Properties for Future Windows in the dialog that appears. Now you'll have a much nicer command window to work with from now on.

h1. Get Set up for SSH

Although you can use the Windows command prompt to act upon your remote server, the primary method used to access Linux systems remotely is SSH (Secure Shell). There's not an SSH client built in to Windows, but good free clients are available. The most popular is PuTTY. "Download the PuTTY installer package":http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html. Choose the download labeled "A Windows installer for everything except PuTTYtel", which will get you the complete set of PuTTY utilities, some of which you'll want later.

Run PuTTY, and you'll see a deceptively simple window. There's actually lots of options here, which you can explore by clicking the categories on the left. But you can get started by using all the defaults and simply entering the name of your host (or its IP address) in the Host Name field and clicking Open. (To save yourself a little typing in the future, you can enter a name under Saved Sessions and click Save, and then the next time you can just double-click this name in the Saved Sessions list.)

Assuming PuTTY is able to connect to your host, you'll then see another of those lovely white text on a black background windows (you can change these settings in the initial PuTTY dialog), with a *Login:* prompt. At this prompt, enter the user name your host assigned you, and then you'll get a password prompt. Enter the correct password, and you'll be online talking to your server, with essentially all the control that a user sitting at the machine has. All data sent back and forth is securely encrypted, so no one will be able to sniff your network traffic and figure out how to get into your server (unlike FTP, in which not only your files but also your user name and password are sent in clear text).

If you aren't able to connect to your server (even to the point of getting a Login prompt), then check the following:

* Make sure your host has enabled SSH access. If you have a shared hosting account, it might not be offered, or you might have to ask for it.
* Make sure you have the host name right. This should be simply the domain of your web site. If it is a new account and you haven't set the DNS yet, you can use the IP address.
* If all else fails, check with your host to see if they've moved SSH to a port other than the standard 22. Some companies are doing this to reduce brute-force attacks. You can enter any port number in the PuTTY dialog.

If, on the other hand, you get the login prompt but it doesn't accept your user name or password, double-check that you have these exactly correct. For some hosts, you may need to use "name@domain.com" and not just "name" for your login name. Check the signup material you received when you opened the hosting account.

Once you have these two command-line environments in place, you have the essential tools to both control your local development environment and to administer your server. Now you just need to know what to type into these windows :-).

h1. For more information:

* "Excellent overview of SSH software for Windows":http://www.jfitz.com/tips/ssh_for_windows.html
* "Windows Command Shell Overview":http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=true
* "Complete (though badly presented) Windows Command Reference":http://technet2.microsoft.com/WindowsServer/en/library/552ed70a-208d-48c4-8da8-2e27b530eac71033.mspx?mfr=true
* "A good third-party Windows command line reference":http://commandwindows.com/command3.htm
* "Cygwin is a Linux-like environment for Windows...":http://www.cygwin.com/
* "Windows Services for Unix"::http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx contained an emulation environment and useful tools. (Deprecated but might be useful.)


    &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=UX4vO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=UX4vO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=jiSYO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=jiSYO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=hWDBo"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=hWDBo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/buildingwebappsarticles/~4/345381764" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://buildingwebapps.com/articles/6398-remote-linux-admin-for-windows-users</feedburner:origLink></entry>
  <entry>
    <title>Understanding Ruby on Rails</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/345381758/6400-understanding-ruby-on-rails" rel="alternate" />
    <id>http://buildingwebapps.com/articles/6400-understanding-ruby-on-rails</id>
    <updated>2008-04-23T00:00:00Z</updated>
    <author>
      <name>Michael Slater</name>
    </author>
    <summary>If you're new to Ruby on Rails, you may be struggling to understand just what Rails is, what it can do for you, and what you need to learn to use it effectively. In this article, we'll explain just that.</summary>
    <content type="html">
If you're new to Ruby on Rails, you may be struggling to understand just what Rails is, what it can do for you, and what you need to learn to use it effectively. In this article, we'll take a quick romp through the various aspects of Rails. We've sprinkled links liberally, so you can use it as an annotated table of contents for the rest of the site.

h2. What is Ruby on Rails?

"Ruby on Rails":/topic/show/5-ruby-on-rails encompasses a number of technologies, and some philosophy as well. This can make it challenging to get your arms around just what Ruby on Rails is.

*"Ruby":/topic/show/6-ruby* is a programming language. By itself, there's nothing about Ruby that is specific to web applications.

Ruby is a modern, object-oriented, dynamic language. In Ruby, everything is an object -- even a number is an object that has methods. Ruby is dynamic; data types are assigned dynamically, and you can extend the language itself as it is executing, defining classes, adding methods, and so forth.

Ruby has a very clean, minimalist syntax. This, combined with its dynamic nature, makes it especially suitable for creating extensions to the language that enable your programs to read almost like English.

*"Rails":/topic/show/5-ruby-on-rails* is a framework for writing web applications in Ruby. The term "Rails" is commonly used to refer to "Ruby on Rails," which is the official name of the framework.

h2. Why Use Rails?

If the application you are building falls into the very large sweet spot for which Rails works well, there's no faster way to write it -- once you're up-to-speed on the framework. There's a sizable learning curve to comprehend the Rails framework, but once you have the basics of it down, you'll be able to produce robust, fully customized applications more quickly than with any other technology.

Because the Rails approach eliminates a lot of the drudgery of writing applications in languages such as Java, and because it makes changes easy and allows you to write expressive, readable code that is easy to maintain, it is simply more fun to build Rails applications. When coding is more fun, you'll write better code.

Because Rails requires less code than most other approaches, you can produce a given application with fewer people. Smaller teams are more efficient than larger ones, multiplying the productivity gains of using Rails.

There's also a great Rails community, so there's lots of open-source plugins and even complete applications, plus countless blogs and other information sources. It's an enthusiastic, helpful, programmer-centric community that puts a high priority both on building great applications and on having fun while you're doing it.

h2. When Not to Use Rails

Rails is not the answer to every problem. Here's a few situations in which it is probably not the best approach:

* If you're new to Rails but are already up-to-speed in another technology, and the app you're building isn't too large, you'll get the work done more quickly by sticking with what you know. This is the major factor that stops most developers from switching to Rails. If you're building a large application, or think longer term, however, working your way up the Rails learning curve is very worthwhile.

* If you can create the application using something like Joomla, in which you can do a lot without writing any code at all, that's probably the quickest approach. You loose a lot of flexibility, however.
* If the application needs to perform tremendous amounts of computation, the relatively slow speed of Ruby may be a disadvantage. This is quite rare, however, and you can always move the inner loops into a language such as C.
* If you expect to have extremely high traffic, your server costs may be higher with a Rails application, and you'll have to do more innovating beyond what the framework gives you automatically. Then again, the time you save building the application may still make it a worthwhile trade-off.
* If you have to share a legacy database with existing code, so you can't restructure it, it may be hard to make Rails work with it.
* If you're building a static site, Rails is probably overkill. Even so, the templating engine in Rails is very useful for such sites, the built-in caching features can eliminate the need to run the Rails code on most accesses, and you can easily build in your own content-management features. But it is more expensive to host Rails sites than static sites, and there's a lot more you need to understand to build them.

As you can probably tell by now, we think Rails is a great solution for the vast majority of web applications.

h2. The Rails Philosophy

Before we get into the specifics of what Rails is composed of, it is helpful to understand the philosophy that underlies its approach.

There's two terms you'll hear a lot with regard to Rails: "convention over configuration" and "DRY (don't repeat yourself).

Convention over configuration is a very important principle behind Rails. It goes hand-in-hand with another attribute of Rails, that it is "opinionated software". The Rails design embodies lots of opinions about how you should structure your code, name your classes and files, and organize your database tables. There are methods to override most of these conventions, but if you go with the flow and follow the conventions, then you can avoid almost all configuration code. That's convention over configuration -- and the payoff is huge.

Keeping your code DRY means avoiding repetition. In its simplest form, it means that if you need the same code in two places, put it in a method so you can write it once and call if from both places. It sometimes increases the amount of work it takes to write your code initially, but it save headaches in the long run. There's various facilities in Rails to encourage this, but it is something you need to pay attention to when writing your code.

In the past year or so, the Rails community has also leaned heavily toward "RESTful":/topic/show/105-rest architecture. There's no requirement to use a REST design, but Rails is increasingly encouraging you to do so, and providing tools to make it easier.

h2. Aspects of Rails

Rails is designed to make it easy and fun to create interactive, reliable, database-backed web applications. Rails is a set of programming libraries, but it is more than that -- it is an approach to developing web applications. These are the major aspects of Rails:

* Rails implements the "model-view-controller":/topic/show/40-model-view-controller-mvc-architecture (MVC) pattern for application design. Your application code is divided into models, which deal with the database and manage the data; views, which present present data to the user and allow the user to interact with the application; and controllers, which mediate between the two.
* Rails provides base classes from which your "model":/topic/show/8-models and "controller":/topic/show/9-controllers classes inherit. This endows your classes with a great deal of capability without writing a single line of code beyond the class declaration.
* Rails includes "Active Record":/topic/show/73-active-record, a module that provides an Object Relational Model (ORM) that automatically instantiates Ruby objects from your database tables. Your code never has to touch the database directly; it deals with Ruby objects, and ActiveRecord takes care of persisting those objects in the database.
* Rails provides many classes and methods that facilitate common tasks in web applications, such as processing data from forms and validating data before writing it to the database.
* Rails "views":/topic/show/10-views are created by a templating system that automatically composites each web page from a "layout":/topic/show/114-layouts, which typically provides the overall structure for the page, a template that defines the unique content of the page, and a special type of template, called a partial, for elements that are used in multiple places.
* The Rails templating system allows you to mix HTML and Ruby code, and it provides a rich set of helpers to simplify the generation of HTML and JavaScript code. There's also a special type of template for producing XML.
* There's also support for "caching":/topic/show/85-caching pages and parts of pages to increase performance.
* "RJS":/topic/show/91-rjs (Ruby JavaScript) templates allow you to write Ruby code that the Rails framework translates to JavaScript for execution in the browser. This is a powerful facility for easily creating sophisticated Ajax interactions.
* Rails migrations enable you to define your database schema with Ruby code, and to easily migrate from one version of the schema to another.
* "Testing":/topic/show/56-testing is built into Rails, streamlining the process of writing and running automated tests for your application at various levels.

So, as you can see, there's a lot to Rails. And there's more -- the Rails ecosystem includes a number of tools and extension methods:

* Generators are special Rails methods that automate the creation of models, controllers, and so forth.
* "Scaffolds":/topic/show/79-scaffolds are a kind of generator that automates the creation of a basic set of integrated functionality. Most often this is used to support the Create/Read/Update/Delete (CRUD) views and controller actions for a given model, but scaffolds are available for other features such as "RESTful":/topic/show/105-rest interfaces.
* "Gems":/topic/show/77-gems are packages of Ruby code that are easily shared.
* Rails "plugins":/topic/show/71-plugins are like gems but are installed directly into a particular Rails application.
* Two "JavaScript":/topic/show/34-javascript frameworks are directly supported by Rails: "Prototype":/topic/show/38-prototype, which extends the JavaScript language, abstracts away browser differences, and makes many common tasks simpler; and "Scriptaculous":/topic/show/39-scriptaculous, which is a visual effects library.
* RDoc and RI are Ruby tools for creating and viewing program documentation.
* The Rails Console provides a command-line environment for interacting directly with your application.
* "Rake":/topic/show/212-rake is an automation tool for performing common tasks in developing Rails applications, such as migrating from one database schema version to another.
* Capistrano is an automation tool for "deploying applications":/topic/show/44-rails-deployment. It automates the process of publishing new versions to a production or staging server, and it also allows you to perform many server tasks without having to explicitly log in to the server and issue shell commands.
* Mongrel is an application server that is widely used to run Rails applications. Typically an "HTTP server":/topic/show/90-http-servers, such as Apache or Nginx, serves up static content and cached pages, while requests that require Rails processing are sent to Mongrel.

h2. Now What?

That wraps up our whirlwind tour of what Rails is and why it's worth learning. Follow the links in the article to learn more about each of the topics. And for an easy way to begin learning, sign up for our "free online course in Ruby on Rails":/course.    &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=i2oYO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=i2oYO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=B1peO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=B1peO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=1oOUo"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=1oOUo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/buildingwebappsarticles/~4/345381758" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://buildingwebapps.com/articles/6400-understanding-ruby-on-rails</feedburner:origLink></entry>
  <entry>
    <title>Seed Conference: The Creative Business Life</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/345381753/6414-seed-conference-the-creative-business-life" rel="alternate" />
    <id>http://buildingwebapps.com/articles/6414-seed-conference-the-creative-business-life</id>
    <updated>2008-04-23T00:00:00Z</updated>
    <author>
      <name>Michael Slater</name>
    </author>
    <summary>The one-day Seed Conference was for the most part, a series of personal essays by three unusually creative folks: Jason Fried of 37signals, Jim Coudal of Coudal Partners, and Carlos Segura of Segura Inc, t26, and a variety of other ventures. The conference was about design, web applications, and business, but its real focus was on creating a life and a business that you enjoy by following your creative inspirations.</summary>
    <content type="html">
&lt;div style='float:left; width:350px; margin: 0 10px 5px 0'&gt;

!/assets/seed-1.jpg!

&lt;/div&gt;

The one-day Seed Conference was an event unlike any of the many conferences I've attended over the past few decades. It was, for the most part, a series of personal essays by three unusually creative folks: Jason Fried of "37signals":http://37signals.com, Jim Coudal of "Coudal Partners":http://coudal.com, and Carlos Segura of "Segura Inc":http://segura-inc.com and a variety of other ventures. All are based in Chicago, where the event was held.

!/assets/segura_fried_coudal-1.jpg!

p{font-size:11px; margin-top:-12px}. Carlos Segura, Jason Fried, and Jim Coudal

The program consisted of each of these three people speaking for an hour or two, followed by a panel discussion. It's hard to put a label on this event, which drew its attendees almost solely by the reputations of the speakers. The event was sold-out and filled the auditorium at the Illinois Institute of Technology to its capacity of 128 attendees.

The conference was about design, web applications, and business, but its real focus was on creating a life and a business that you enjoy by following your creative inspirations. For anyone working in a large company, it was a persuasive, though indirect, call to strike out on your own (one that we heeded some time ago). For designers doing freelance work or running agencies, it was a rallying cry for creating your own products, rather than spending all your time applying your skills on behalf of others. And for everyone, it was an impassioned pitch for following your instincts, creating the best products you can, and having a great time doing it.

h2. Carlos Segura: Art, Type, and Inspiration

Carlos worked as an art director for a string of large ad agencies before striking out on his own in 1991. He now runs multiple ventures, including the Segura Inc. agency, "t26 type foundry":http://t26.com, "5inch":http://5inch.com (silk-screened blank DVDs), and "Cartype":http://cartype.com (more than you can imagine about car emblems and logos).

Carlos showed examples of amazing, multifaceted campaigns he created for Corbis and RockShox. Check out the "client list on the Segura Inc. site":http://segura-inc.com/clients.php for links to a variety of their work.

Carlos created the "t26 type foundry":http://t26.com in 1994 out of frustration with the fonts available and the hassles with using it. By applying his own branding and marketing skills, on top of enlightened policies (t26 is the only type supplier that allows designers to legally provide fonts to service bureaus) and great new typefaces, he's built t26 into one of the largest independent type foundries.

h2. Jason Fried: The 37signals Way

Jason Fried , the founder of "37signals":http://37signals.com, needs no introduction here, but perhaps the history of 37signals is not as well known. Jason began as a freelance designer and didn't really form a company until he had freelanced for three years and got the job to design GettyOne, for which he needed another designer. 37signals, founded in 1999, still has only 10 employees, most of whom work primarily from home. For such a small company, it has had a big impact.

37signals became a product company with the launch of "Basecamp":http://basecamphq.com, from which Ruby on Rails was extracted. Basecamp was initially built as an internal tool, and then turned into a product. Their initial goal was $5K per month in revenue, which they exceeded within six weeks of launch. A year later, 37signals dropped all client work.

Jason remains focused on user experience, while David Heinemeier Hansson, the co-owner of 37signals and original author of Rails, leads the development side of the business.

Jason's talk was, for the most part, his well-honed "Getting Real" pitch. If you haven't already read the "Getting Real book":http://gettingreal.37signals.com and you've made it this far into this article, it should be next on your list.

h2. Just Wing It

Jason is a vocal advocate for doing away with most planning and just diving in and building products. He argues that plans never end up being what happens anyway, and that you're better off focusing your time on activities that lead directly to something you can put in front of customers. He takes an approach that is akin to Agile methods in the software development world, but applied to building businesses and doing design -- and taken, perhaps, to an extreme. He calls for us to "embrace the unknown" and "just wing it" since "you don't know what you're doing anyway until you're doing it."

There's a fascinating discussion to be had over the counterpoint that planning can provide a lot of value, but that didn't happen at this event, and it will have to wait for a future article to appear here.

Another key point was that all too often there are too many cooks (too many participants in a project) and too few chefs: leaders who freely share their knowledge, as in cookbooks, in cooking shows, and so forth, and thereby build powerful personal brands while spreading their knowledge. Jason pointed out that Getting Real is the 37signals cookbook and asks, "What's your cookbook?" (This site is growing into ours.)

Jason advocates for small teams and an easy-going approach. 37signals gives everyone Fridays off during the summer months, and Jason says just as much work gets done. He recommends hiring "managers of one" -- in other words, people who are self-managing.

As for work style, Jason spoke out against the pervasive open workplace with its focus on nearly constant communication. "A lot of people think interruption is collaboration," he commented.

Financials remain one topic that Jason won't discuss, but he did say that Basecamp is the company's most profitable product, and Campfire its least-profitable.

Some other tidbits:

* They do all their prototyping in HTML and CSS, and don't use Photoshop for mock-ups.
* They don't actively market the company, other than by blogging and speaking.
* "Highrise":http://highrisehq.com came from an internal need to track journalists they were talking with.

h2. Jim Coudal: Business Serendipity

Like Carlos Segura, Jim Coudal runs a creative agency ("Coudal Partners":http://coudal.com) and a host of spinoff products and businesses, including "The Deck":http://coudal.com/deck/ (ad network), "The Show":http://www.theshowlive.com/ (concert recordings), and "Jewelboxing":http://www.jewelboxing.com/ (nice jewel boxes for CDs and DVDs). These sites are worth spending some time on just for inspiration, even if you aren't interested in the products.

The site "Coudal":http://coudal.com has so much content on it that a note at the bottom proclaims, "We actually do stuff other than update this site," with a link to the "About Us" page.

Jim described how he moved away from client work, as an example of serendipity and following opportunities that present themselves. After years of doing design, web development, and filmmaking on behalf of clients, Coudal began developing short films and other projects just to show off the firm's talents. When a British TV production company expressed interest in turning one of these films into a series, Jim thought that was going to be their path away from client work. When sending out a sample DVD, Jim went looking for better packaging for the DVD.

The TV show never happened, but "Jewelboxing":http://jewelboxing.com was born. Check it out if you need cool CD or DVD packaging.

Triggered by an opportunity to produce CDs of live concert recordings for sale to concert-goers, Jim founded "The Show":http://theshowlive.com, in partnership with a Jewelboxing customer.

Jim points out that enthusiasm for new ideas is typically highest early on, so by pursuing a series of projects you can stay higher on the enthusiasm curve.

Like Jason, Jim argues against the need for things such as business plans. He described his goal as being to "find a way to screw around at work all day and get paid for it," and it sounds as though he has accomplished just that!

h2. Ready to Go?

Was it worth spending a day at? Absolutely. If I hadn't already read and absorbed Getting Real, it would have been even more so. Whether it was worth a San Francisco to Chicago trip, complete with a four-hour flight delay and waiting outside for a cab in snowy, 15-degree weather, is a tougher call, but I'm glad I went. A two-day conference would have made much better use of all the travel time, though.

Future Seed conferences haven't been scheduled, but given the sell-out crowd and how much the presenters seemed to enjoy themselves, it seems likely. Visit "seedconference.com":http://seedconference.com if you want to join the notification list for any announcements.

h2. Other articles about the Seed Conference:

* Mike Rohde's "sketchtoons":http://www.flickr.com/photos/rohdesign/sets/72157602795582286/ conference notes
* Mike's "blog post":http://www.rohdesign.com/weblog/archives/002389.html
* "thoughtbot":http://giantrobots.thoughtbot.com/2008/1/22/the-seed-conference-in-chicago
* "jess3":http://www.jess3.com/blog/2008/01/chicago-seed-conference-moto.html (with great pictures)
* "Flickr photos":http://flickr.com/search/?q=seed+conference from the conference    &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=wozTO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=wozTO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=2EGyO"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=2EGyO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/buildingwebappsarticles?a=tBgqo"&gt;&lt;img src="http://feeds.feedburner.com/~f/buildingwebappsarticles?i=tBgqo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/buildingwebappsarticles/~4/345381753" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://buildingwebapps.com/articles/6414-seed-conference-the-creative-business-life</feedburner:origLink></entry>
  <entry>
    <title>Exception Handling and Old URLs</title>
    <link href="http://feeds.feedburner.com/~r/buildingwebappsarticles/~3/345381762/6396-exception-handling-and-old-urls" rel="alternate" />
    <id>http://buildingwebapps.com/articles/6396-exception-handling-and-old-urls</id>
    <updated>2008-04-23T00:00:00Z</updated>
    <author>
      <name>Michael Slater</name>
    </author>
    <summary>Whenever I deploy a Rails site, I install the exception notification plugin so I get an email if a user provokes a bug I hadn't found. It's a piece of cake to install ...</summary>
    <content type="html">
Whenever I deploy a Rails site, I install the exception notification plugin so I get an email if a user provokes a bug I hadn't found. It's a piece of cake to install:

1. Install the plugin

&lt;pre&gt;&lt;code&gt;ruby script/plugin install exception_notification&lt;/code&gt;&lt;/pre&gt;

2. Include the plugin in your ApplicationController (in the application.rb file)

&lt;pre&gt;&lt;code&gt;include ExceptionNotifiab