Posts tagged ruby


Improving the load time of your application

performance loadtime ruby sinatra monk | comments

Step 0: Benchmark!

(Disclaimer: the code that follows is in no way a prescription on how to write good benchmarking code but was simply written in a minute :-)

Continue reading »


Dtach is the way

daemon ruby background worker | comments

If you have a worker that doesn't stop (looping endlessly and waiting for some queue to have a job), you might want to have the ability to put this worker in the background for the following reasons:

Continue reading »


Lua Day 1: So near yet so far

ruby lua | comments

So far Lua is strikingly similar to ruby. This of course only appears to be the case for very simple scripts.

Some common things so far:

  1. Condition expressions accepts any value, and false / nil are the only things which are failures. 0 and "" are both true.
Continue reading »


uninitialized constant Delayed::Job

delayedjob rails ruby workers | comments

Just a quick shout out for those having a problem with the latest DelayedJob, this is a quick fix!


RVM Gemsets: Awesomeness

rvm gemset require rubygems | comments

If you have recently been keeping up to date with Ruby, and have tried using multiple versions at the same time, you're most probably using RVM to manage these different versions.

Continue reading »


Ruby Coding Conventions

rack coding standards ruby | comments

I've recently been following chris neukirchen's coding conventions by the letter. All of them are really good. But one of the most interesting and probably opinionated convention he advocates is this:

Continue reading »


Rails3: Factory girl and file uploads

rails3 ruby edge ruby19 factory_girl | comments

Our experience so far with rails 3 has been pretty good. Some of the modules and internals of rails were renamed, but so far we haven't experienced anything that changed drastically. Most of the stuff still have some parallelisms.

Continue reading »


Our first app in Rails 3

rails3 ruby edge ruby19 | comments

We're building a very simple app, and we decided to start with Rails3. Here is our stack so far:

  1. Rails3
  2. HAML
  3. Paperclip
  4. is_taggable
  5. twitter-auth
  6. mocha
  7. shoulda
  8. factory_girl
Continue reading »


Hello whenever, goodbye manual crontab

whenever cron ruby capistrano | comments

Do you hate managing cron configurations manually? How about maintaining different cron configs for every Rails application you might possibly have?


Say hello to a ruby gem called whenever. It basically allows you to configure your cron jobs in ruby. An example to illustrate:

Continue reading »


The Array function in Ruby

ruby array tricks chops | comments

I've seen code before that do the following:

collection = [ var ].flatten # where var might or might not be an array

This idiom is better expressed using

Continue reading »


Latest and Greatest?

queues background rails ruby redis | comments

I have been very interested and locked to background processing ever since I've employed it. I have tried Starling, Delayed::Job, beanstalk, ActiveMessaging, ZeroMQ, and RabbitMQ. Here's a quick rundown:

Continue reading »


Recomed Relaunch and Murphy's Law

recomed ruby stubbing ssl rapidssl | comments

From wikipedia:

Murphy's law is an adage that broadly states: "Anything that can go wrong will go wrong."

Today, we relaunched recomed. We planned to include SSL in the login page, contact importer, password reset, edit profile (anything with sensitive information basically).

Continue reading »


The Art of Mixing in

ruby mixins modules rails models | comments

The Giant Central Model

I've been working for over a year at, which basically is a social network for doctors that aids people in potentially finding the right doctor for their needs.

Continue reading »


IE7 XmlHttpRequest parseerror problem

browsers ajax debugging ruby rails metal | comments

Hair Pulling Galore

Have you ever run into the problem in Rails Metal where AJAX Requests just choke? When you try and debug the error response, it would stupidly reply "parseerror".

Continue reading »


Rails 2.3.2 Object not Missing Constant Xxx

rails ruby debugging namespace routes | comments

I ran into this error earlier, and I got to tell you, this is really one puzzling error message.

Basically I have the code in my routes that does this:

Continue reading »


Acts as Solr 3x Performance Boost on Tests

ruby testing tdd bdd acts_as_solr performance | comments

If you're using acts_as_solr and not disabling it on your tests, or want to enable or disable it selectively, try my fork of mattmatt-acts_as_solr on

In a nutshell, you put this in your test_helper:

Continue reading »


Waiting for Shoulda to work with Rails 2.3

rails23 ruby19 shoulda | comments

Since Rails 2.3 is the only Ruby 1.9 compatible version of rails, and shoulda hasn't yet made the move to support Rails 2.3, I'm gonna play a little waiting game and try and let the guys at thoughtbot update shoulda.

Continue reading »


Switching to Kestrel (from Starling)

starling ruby rails ruby19 kestrel queuing | comments

Since I'm slowly (but surely) making the move to ruby 1.9 each day, I discovered that starling doesn't work with ruby 1.9, and most probably, it never will.

The guys at twitter have moved to kestrel for a time now, so I guess that's the best move for me as well. Considering switching to an entirely different queue server with a different protocol will incur too much overhead as of this moment.

Continue reading »


AWS-S3 now Ruby 1.9 compatible

aws-s3 ruby19 amazon | comments

Marcel Molina just upgraded his copy on github.

Check it out here


The long and winding road to ruby 1.9

ruby19 amazon aws-s3 blackbook | comments

I've been trying to update to ruby 1.9. So far here are some notes:

Amazon S3

I patched it myself. here it is:


Found a Ruby 1.9 compatible version at

Continue reading »