Posted by Jesper on May 18, 2010
About five weeks ago I launched a new version of The site was rebuilt from the ground up using several bits and pieces of technology that I had wanted to try out for some time:

  • Refinery CMS
  • ThemeForest
  • Heroku

    Refinery CMS: There are currently three Rails based CMSs that I think are suitable for production use: Radiant, BrowserCMS and Refinery. Radiant is the grand-old man of Rails CMSs, but I never really fell in love with it. BrowserCMS looks like a really solid CMS with loads of features, especially features you would expect to find in commercial “enterprise” offerings. I find the interface to be quite complex, to the point where I think it will require training end users in its use, but I am sure it has its uses on larger CMS implementations. Refinery CMS is a fairly new Ruby on Rails CMS, that comes with a nice and clean interface and has the most basic functionality built-in, like image and file-upload.

    ThemeForest: They have some great HTML templates, and this is now the first place I go to to find a template for a new project. Themes cost around $10-20 and the fact they charge for them, means you won’t see them on thousands of other sites.

    Heroku: Probably the slickest Ruby cloud platform available today. Deployment basically comes down to pushing your code to a remote repository on Heroku. That’s it! Heroku is a fully managed platform, so you never see a shell prompt, and don’t need to worry about installing any part of the Ruby web stack.

    Refinery, ThemeForest and Heroku turned out to be a really potent mixture. Refinery helped me get a few pages of content up really quick and allowed me to easily add some custom functionality. The ThemeForest template solved was it often the biggest obstacle for a design-challenged developer: Making the site look professional. Heroku made deployment the simplest thing in world. I could have deployed to an existing server of mine with minimal effort, but that would have left me with one more application to babysit. As long as you plan on deploying to Heroku from the beginning by using PostgreSQL for development, Amazon S3 for file storage and make sure any gems or plugins are compatible with Heroku, you should have no difficulties getting your application deployed to Heroku.

Make attachment_fu and Refinery CMS work with Amazon S3 EU buckets

Posted by Jesper on April 06, 2010

Problem: You need to use attachment_fu for uploads in Rails, and would like to store your uploads in an Amazon S3 EU bucket. Amazon updated their API long ago, when they made EU buckets available, but for some reason the defacto standard library for working with S3 from Ruby, AWS::S3, was never updated to support the new API. As a result, you still can’t use the original AWS::S3, if you prefer storing your uploads on Amazons servers in Europe.

Now, there are other libraries that support EU buckets, like RightAWS or S3, but the upload plugin you use (in this case attachment_fu) has to support it. Previously the solution would be to switch to a different upload plugin that used another library, like Paperclip, but last time I checked, Paperclip had replaced RightAWS with AWS::S3. You might also for some reason not be able to switch to a different upload plugin.

On a recent project I was using the excellent Refinery CMS, which comes integrated with attachment_fu. I figured the problem using S3 EU buckets had been long solved, but apparently not, so here is the solution I cooked up:

  1. Install sauberia’s fork of AWS::S3: either as a gem or a plugin in your Rails project.
  2. Install the attachment_fu plugin (Refinery CMS already has this):
  1. Patch attachment_fu to generate URLs that work correctly with Amazon S3 EU buckets, by using the code shown below:

  2. save this as vendor/plugins/attachment_fu_hacks/init.rb

    require 'aws/s3'

    Technoweenie::AttachmentFu::Backends::S3Backend.module_eval do

    # Hacked to use new S3 addressing, which lets us use EU buckets. # Requires sauberia's fork of aws-3s: # # All public objects are accessible via a GET request to the S3 servers. You can generate a # url for an object using the s3_url method. # # @photo.s3_url # # The resulting url is in the form: <tt>http(s)://:bucket_name.:server/:table_name/:id/:file</tt> where # the <tt>:server</tt> variable defaults to <tt>AWS::S3 URL::DEFAULT_HOST</tt> ( and can be # set using the configuration parameters in <tt>RAILS_ROOT/config/amazon_s3.yml</tt>. # # The optional thumbnail argument will output the thumbnail's filename (if any). def s3_url(thumbnail = nil) File.join(s3_protocol + bucket_name + '.' + s3_hostname + s3_port_string, full_filename(thumbnail)) end end
  3. Disclaimer: I have only tested this with Rails 2.3.5.

    Update November 08, 2010:

    It seems that Amazon updated the S3 API sometime around the end of October 2010. To successfully upload you now have to use a region-specific endpoint. If you followed this guide, you need to add “server:” to your config/amazon_s3.yml file.

    See this post for further details: Issues using Amazon S3 European Buckets. launches course registration site

Posted by Jesper on March 20, 2010

Scrum.orgLast week launced a redesigned homepage. As part of the redesign I assisted with the development and customization of

Founded by Ken Schwaber, the co-creator of Scrum, and other leading international Agile experts, provides a complete solution for companies seeking high-impact results from Scrum and Agile development.

One of the offerings by is the Professional Scrum Developer program. It is an interesting take on Scrum training—not for Scrum Masters or Product Owners, but for developers.

You can read more about the launch on

Monitoring Rails POST requests

Posted by Jesper on March 19, 2010

Just found this draft post, that I had almost forgotten about. If you need to monitor POST requests to your Rails application for whatever reason, here is an easy way of doing it:

class HomeController < ApplicationController

skip_before_filter :verify_authenticity_token, :only => :post_up def index end # monitored by # this will test if Rails is up and responding to GETs and POSTs def rails_up url = URI.parse(url_for(:action => 'post_up')) res = Net::HTTP.post_form(url, {}) # body will be "success" if POST request is successful render :text => res.body rescue Exception => e render :text => "error: #{e.to_s}" end # verify that POST requests are working # we've had problems with Apache segfaulting on POSTs def post_up render :text => ? "success" : "only POST allowed" end end

Only downside to this, is that it generates an additional request for every request to /rails_up. If you run a low number of Mongrels or Passenger instances, this might be a problem.

Scrum Training Institute on Rails

Posted by Jesper on September 18, 2008

Scrum Training InstituteThis week I launched a new site for The Scrum Training Institute at If you’re getting started with Scrum or Agile these are the experts you want to learn from! Currently their team consists of Jeff Sutherland (co-creator of Scrum), Jens Østergaard (a fellow dane), Gabrielle Benefield and Pete Deemer.

Working with them has been just great. As a developer I just love having clients, that unasked will send me emails going:

Jesper, here’s the story:
As a customer, I want to be able to…

The site is live now and we will be adding more features over the coming weeks, as I work my way through the backlog.

Rails 2.1.0 without a Database

Posted by Jesper on June 03, 2008

If you are running the just released Rails 2.1.0 and have disabled ActiveRecord, you will likely run into problems launching script/server.

The culprit is the new config/initializers/new_rails_defaults.rb, which should test to see if ActiveRecord is loaded.

The bug report is here and the patch “AR can be disabled, new_rails_defaults.rb should check” has already been applied.

It’s a very tiny patch, so until the next Rails release is out, you can easily apply the patch manually.

My latest Radiant project is now live!

Posted by Jesper on February 06, 2008

KORPUS SundhedsparkI don’t usually work on “plain old websites”, but I had an itch to try out Radiant CMS, and so I decided to take a small gig building a showcase site for a real estate developer (or property developer, depending on which side of the pond you’re on).

So far Radiant has been a pleasant experience and I’ll definitely use it for a couple of other sites. Initially my impression was that it had way too few features to be of any real use, but it has the 20% features that you use 80% of the time. For the rest there’s a bunch of extensions, some which are almost mandatory for any site, like the page_attachments extension, that enables file-uploads on all pages. Also, Radiant is based on Rails, so if you can’t find an extension with the functionality you need it can be easily extended.

Working with Radiant also gave me a chance to look into Rails hosting options in Europe. Most of the dedicated Rails hosting companies have data centers in the US, so I needed to look elsewhere. I ended up hosting the site on a VPS from RimuHosting, who have a data center in London. They don’t specifically promote themselves as a Rails host, but they do have instructions for running Rails on their servers and they will install a complete Rails stack for you if you just ask when ordering the VPS. Setup was a amazingly fast even though it involved a real person handling my order. Within 15 minutes of submitting the order I had an email back saying they were working on my order and about 30 minutes later I was logging in to my new server!

The site is live now at (in Danish).

Java programmer == ‘maintenance’

Posted by Jesper on January 29, 2008

Pragmatic Dave on Passion, Skill and ‘Having A Blast’:

... you should be investigating your tools set and you should be trying different techniques and different ways of doing things. And maybe then, more and more it looks back into practices. And that’s not just to make you better at your job, it’s also to make you safer in your job. Because, at the speed things are changing, in 10 years the job description for Java programmer is going to be “maintenance.” And that’s just the case, just the way things work in this industry.

So, what are you waiting for? Get moving. Learn a new language. Today.

RailsConf 2008 Europe Announced

Posted by Jesper on January 21, 2008

David just announced RailsConf Europe ‘08:

The conference is returning to Berlin and the conference will happen between the 2nd and 4th of September.

Registration will open in May 2008. Hope to see you there.

RailsConf 2008: Submit Your Proposals

Posted by Jesper on October 30, 2007

We were there

You can now submit your proposal for RailsConf 2008 taking place May 29-June 1, in Portland.

With that off my chest, I can move on to the real purpose for this post: The photo, taken at RailsConf 2007 and featured on the frontpage of the RailsConf 2008 site, has yours truly and Morten Christensen smack in the center!