Ruby on Rails Dreamhost plugin

February 2nd, 2007

Update 2/11/07: Just to clarify, this plugin won’t keep your Rails site running on Dreamhost if the sum of all your running processes exceeds 200MB (which is when their process monitor kills your processes). Run ps aux and sum the VSZ column and then divide by 1024. If you’re pushing the limit and are only running one Rails site you may want to look at another provider. If you’re running multiple Rails sites, run each site under a different user (one account can create many users).

Per Thomas Aylott’s suggestion on my previous post Keeping Rails Running at Dreamhost Part 2 I’ve decided to release my Dreamhost signal handling code as a Rails plugin. I’m using it on a Rails 1.2.1 site and a Rails 1.1.6 site.
Read the rest of this entry »

Keeping Rails running at Dreamhost Part 2

January 24th, 2007

Update 2/2/07: Per Thomas’ comment I’ve released the code below as the dreamhost rails plugin.
Update 1/25/07: People have reported difficulties copy and pasting the dispatch.fcgi source code from this blog post so here is a dispatch.fcgi to download. Make sure you make it executable!

My first attempt to keep my Ruby on Rails sites running at Dreamhost involved modifying dispatch.fcgi to implement the frao_handler approach as described on the wiki. This left me with a 3% 500 error rate. Ughh!
Read the rest of this entry »

Switching from Edge Rails to 1.2 stable with Piston

January 24th, 2007

Update 1/25/07: Francois pointed out that now as of Piston 1.3.0 you can now do this all with the following command:

piston switch http://dev.rubyonrails.org/svn/rails/tags/rel_1-2-1 vendor/rails

For starters, if you’re still using svn:externals to manage your vendor/rails directory it’s time to switch to using Piston. svn:externals is so Q4!
Read the rest of this entry »

An interview with the authors of JRuby

January 22nd, 2007

The Java Posse hosted a great podcast interview with the authors of JRuby: Charles Nutter and Thomas Enebo. Additionally you get to hear what Tor Norbye is up to with his work on NetBeans Ruby integration and it looks like there’s some nice code assist features in the works! Really good code assist is the thing I miss most when doing Ruby (in RadRails) as opposed to Java (in IDEA).

It’s exciting to see the convergence of my two favorite languages coming along!

Keeping Ruby on Rails running at Dreamhost

January 9th, 2007

Update 1/12/07: This solution has reduced my 500 error rate down to less than 0.2% but it’s still not perfect. I continue to plug away at this…

Update 1/24/07: I’ve finally solved my Dreamhost 500 error problems with a different solution described in Keeping Rails running at Dreamhost part 2

This weekend I moved two of my newer Ruby on Rails based sites (http://windandtides.com and http://gearandboats.com) over to Dreamhost. You simply can’t beat their prices for hosting a small site (if you prepay for 2 years and use coupon code GABRITO to save $50 the total is $140.80) and I’ve found their customer service to be pretty responsive too.
Read the rest of this entry »

The Rails Way delivers the goods

December 18th, 2006

I had a piece of data import code in Wind and Tides that I just knew could be cleaner and more elegant. Last week I submitted it to Jamis and Michael who write the Rails Way blog and their refactoring of it exceeded my expectations and taught me a thing or two in the process. Their blog is definitely worth a read if you’re trying to take your rails coding to the next level!

Tab completion and history with irb and script/console

December 6th, 2006

One thing I love about Ruby (and really miss when working in Java) is its interactive command line interpreter irb (or script/console if you’re using Rails). I really wish irb had tab completion and saved history configured by default out of the box. The good news is it’s easy to configure by creating a $HOME/.irbrc file with the following contents:
Read the rest of this entry »

Hello Newshutch, goodbye Bloglines

December 4th, 2006

I’ve been a Bloglines user for a long time. However, after hearing about Newshutch on the Web 2.0 show podcast Episode 26 I’ve made the switch and couldn’t be happier. It sports just the right amount of Ajax, good keyboard shortcuts, and it’s built with Ruby on Rails. In short it’s by far the best web based RSS reader out there, check it out!

Comparing Amazon EC2 with VPS and dedicated hosting

November 30th, 2006

I’ve been reading all the great things about Amazon EC2 (or Elastic Compute Cloud) and lots of pricing comparisons with VPS and dedicated hosting. I finally got an EC2 account and tinkered a bit and there’s a big difference between EC2 and Virtual Private Server or Dedicated hosting that most of the preliminary write-ups I’ve seen completely overlook.
Read the rest of this entry »

Ajax enabling crusty legacy webapps with Prototype

November 26th, 2006

With all of the hype around Ajax it’s easy to think you might need an MVC framework with baked in Ajax support like Rails ActionPack or JBoss Seam to make Ajax easy. However, libraries like Prototype (which is what Rails uses) make it so easy that it’s a snap to Ajax enable even the crustiest legacy web application!

Let’s take a look at what it takes to put a simple unordered list on a page with a refresh button to refresh the list without doing and page reload and then we’ll spruce it up a bit:
Read the rest of this entry »