I figured I'd give Typo a try on JRuby today. It has been working for quite a while, but with the GlassFish gem improving so much I thought it would be good to write up an updated walkthrough. It's pretty simple.
BTW, is Typo still the preeminent blog package for Rails? I certainly don't want to be out of fashion.
Prerequisites:
- MySQL already set up and working, with TCP sockets enabled (or I guess you can use SQLite too)
- Java (sudo apt-get install sun-java6-jdk or whatever's appropriate for your platform)
- JRuby (download, unpack, put bin/ in PATH)
- Appropriate gems installed (rails, activerecord-jdbcmysql-adapter, glassfish or mongrel)
The process:
- Download Typo. The gem unfortunately tries to install native extensions like sqlite3 and mysql (I sure wish they wouldn't do that!)
- Unpack the Typo zip wherever you want your blog site to live and cd into that directory
- Edit config/database.yml.example to your liking, replacing "mysql" with "jdbcmysql" and save it as config/database.yml
- Create the database:
jruby -S rake db:create RAILS_ENV=production
- Migrate the database:
jruby -S rake db:migrate RAILS_ENV=production
- Run the server:
glassfish -p <port> -e production [and whatever other options you want]
orjruby script/server -p <port> -e production
- Set up Apache to point at your new Typo instance (optional)
That's all there is to it! You'll want to be the first one to hit your new blog, so you can set up your admin account and lock down the server.
Perhaps it's time I finally moved my blog off Blogger and on to a JRuby-hosted server, eh?
Suggestions, improvements to this process? Add to comments and I'll update the post.