Integrating Jekyll with FeedBurner

It’s relatively easy to get the feed for your Jekyll site running on FeedBurner. Firstly, you need to choose a subdirectory to host your feed on. Calling it feed seems to be a fairly popular choice, so I decided to follow the crowd. Create a folder called feed at the base of your Jekyll site, and create an index.xml file inside with the following contents (obviously swapping the references to Recursive for your own site details) : ...

September 14, 2010 · 3 min · Dave Perrett

Installing git-up on Ubuntu 8.10

Recently I had a bit of trouble getting {{ “github.com/aanand/git-up” | ext_link: “git-up”}} to work on Ubuntu (or anywhere else for that matter), so here’s some of the steps I had to go through. Initially ubuntu seems to have RubyGems 1.01 and 1.2.0 installed : > gem --version 1.2.0 >/usr/bin/gem1.8 --version 1.2.0 >/usr/bin/gem1.9 --version 1.0.1 ...

February 14, 2010 · 2 min · Dave Perrett

Updating RubyGems on Mac OS X 10.5 Leopard

I haven’t used ruby for a while, but recently wanted to try out {{ “github.com/aanand/git-up” | ext_link: “git-up”}} on OSX. According to the {{ “github.com/aanand/git-up/blob/master/README.md” | ext_link: “instructions”}}, a simple gem install git-up should work : > sudo gem install git-up Updating metadata for 1 gems from http://gems.rubyforge.org . complete ERROR: could not find git-up locally or in a repository I assume this is something to do with gem hosting moving to github or something… I haven’t really been following ruby for a year or so so I’m not sure exactly what’s going on. It seems i’m running a pretty old version of RubyGems, so I tried to update : ...

February 14, 2010 · 2 min · Dave Perrett

'spec/rake/spectask' errors doing rake db:migrate

If you get an error similar to the following while running rake db:migrate : error no such file to load -- spec/rake/spectask … you need to install the rspec gem : > sudo gem install rspec

April 29, 2009 · 1 min · Dave Perrett

'Can't find Magick-config' error installing rmagick gem

If you are getting the error ‘Can’t find Magick-config’ when installing the RMagick gem, chances are you’re missing the libmagick9-dev library. /opt/ruby-enterprise-1.8.6-20090201/bin/ruby extconf.rb install rmagick checking for Ruby version >= 1.8.2... yes checking for gcc... yes checking for Magick-config... no Can't install RMagick 2.9.1. Can't find Magick-config in ..... To fix this on ubuntu, simply install libmagick : apt-get install libmagick9-dev

April 26, 2009 · 1 min · Dave Perrett

undefined method assert_valid_keys in Rails

If you are getting an error about ‘undefined method assert_valid_keys’ in Rails : undefined method `assert_valid_keys' for :time_entry_product:Symbol … it may be because you have two relationships specified on the same line in your model : ...

February 24, 2009 · 1 min · Dave Perrett

Nginx adds strange characters using rails/memcached_pass

After upgrading a few gems recently, I found that the content returned from the nginx memcached_pass directive always had a few strange characters prepended. After some investigation it seems that this is caused by rails ‘marshalling’ the data. If you’re using a memcached set command such as Cache.set(key, content, time_to_live) You need to add an extra argument to force rails to cache the raw data instead of marshalling it : ...

December 23, 2008 · 1 min · Dave Perrett

Phusion Passenger PassengerMaxPoolSize is ignored

I’ve been wondering for a while why Phusion Passenger seems to completely ignore the PassengerMaxPoolSize, PassengerMaxInstancesPerApp and PassengerPoolIdleTime directives. I recently discovered that they don’t work inside VirtualHost blocks in apache config. The old (non-working) config was something like : ...

December 22, 2008 · 1 min · Dave Perrett

memcaches_page plugin for Rails

This plugin is very similar to the built-in Rails ‘caches_page’ functionality, except it caches to memcached rather than a file. It relies on the ‘memcached_pass’ nginx directive to serve pages directly from memory if possible, and only passes to rails if necessary. On my server I’ve seen a 75% reduction in Ruby memory usage using this technique. ...

December 3, 2008 · 3 min · Dave Perrett

Rails NameError

If you’re getting NameError (uninitialized constant UnknownAction) using UnknownAction in the ‘rescue_action_in_public’ method, try to use the full reference (::ActionController::UnknownAction) instead of ActionController::UnknownAction. For example : ...

August 20, 2006 · 1 min · Dave Perrett