If I’ve learned anything from Typo, it’s that Rails apps are a serious pain for first-time users to install. Here’s what it takes to get Typo (or any open-source Rails app) up and running on a random Unix box today:

  • You need a working database, like MySQL or PostgreSQL.
  • You need to know how to create at least two databases for Typo.
  • You need Ruby 1.8.4
  • You need rubygems installed.
  • You need Rails 1.1.x
  • You need Ruby drivers for your DB.
  • You need Ruby FCGI drivers installed
  • You need a web server with FCGI installed
  • You need to download Typo and figure out how to install it without a useful README.
  • You need to configure your web server to run Typo’s FCGI dispatcher.
  • You need to get all of the permissions right, especially if your web server runs under a different user ID then you normally use.

Sometimes I’m amazed that Typo has as many users as it does. I’ve been promising to do something about this for months, and it’s finally getting close to working. Here’s what you’ll need to do to get Typo running once I’ve released the installer:

  $ gem install typo
  (installs Typo, Rails, mongrel, sqlite3-ruby, and whatever else we need, as defined by the Gem spec)
  $ typo install /var/www/my_typo_site
  Typo Installer
   Checking for existing Typo install in /var/www/my_typo_site
   Reading files from /usr/lib/ruby/gems/1.8/gems/typo-4.0.0
   Copying 755 new files into /var/www/my_typo_site
    copying /CHANGELOG
    copying /MAINTAINERS
    copying /MIT-LICENSE
    ...
  Creating default database configuration file
  Creating initial Typo SQLite database
  Migrating Typo's database to newest release
  Running tests.  This may take a minute or two
  All tests pass.  Congratulations.
  Starting Typo on port 4936

  Typo is now running on http://scott17.local:4936
  Use 'typo start /var/www/my_typo_site' to restart Typo after boot.
  Look in /var/www/my_typo_site/installer/apache.conf.example to see how to integrate Typo with Apache.

The installer sets up a complete Typo installation from a Ruby Gem in a directory of your choice, and then take care of creating a SQLite database for you. Instead of FastCGI, it uses Mongrel, because it’s easier to do HTTP proxying then FastCGI 95% of the time. The same installer knows how to upgrade an existing Typo install–just run typo install on the same directory again, and it’ll shut down mongrel, back up your database, upgrade all of the files that need changed, run migrations, retest the installation, and then restart Mongrel.

This isn’t the ideal install for everyone, but it should be good enough for most people, and there’s really nothing preventing people from hand-installing Typo. There’s certainly nothing preventing people from using Capistrano or any other heavier-weight management system, but that’s overkill for most personal blogs.

Right now, the installer works for me, but it’s not quite ready for wider use. I still need to add Rails freezing support, as well as a bit of subversion support, and I need to clean up the code a bit more. Once that’s done, I’ll check it all into the Typo trunk and then I’ll start building Typo 3.99.x GEMs for people to test. Once we’re reasonably confident that the installer and the current trunk work for people, I’ll go ahead and release Typo 4.0.0.

Once Typo 4.0 is out, I’ll see what I can to do extract the Typo installer into a generic installer for lightweight Rails apps. I doubt that Typo is the only project that could use something like this.