+1.647.833.3852 [email protected]

Wicked_PDF working in Rails 3.1

I recently updated one of my apps to Rails 3.1 and found that my PDF generating tests were failing because they were unable to find the CSS or images to use in the PDF. So I started playing around, and here is what I got: In your app, add a new initializer (or edit...

Cucumber visiting pages using different formats

Ever wonder how you can write a cucumber test that would test how your web app responds to a different format, something like JSON or XML? I was trying to do the following: Ruby Background: Given I am logged in And there is the following feeds: | title | body |...

RVM install ruby-1.8.7-p330 fails

Today I’m thinking of getting back into so good old work and I read there is a new patch to Ruby, version p330. So I figure that RVM (Ruby Version Manager) being so easy and quick to update, I’d do the good old “rvm get head, rvm reload, rvm update...

OSX 10.6.5 breaks Apachectl

Trying to run: sudo apachectl restart Are you getting: /usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument Edit your /usr/sbin/apachectl on line 65 from: ULIMIT_MAX_FILES="ulimit -S -n ulimit -H -n" to: ULIMIT_MAX_FILES="" and try...
Stripping ASCII colour from a ruby string

Stripping ASCII colour from a ruby string

I spent a few good hours trying to figure out how to strip a coloured ruby string: which comes out as this: >> p t"2 scenarios (e[33m2 undefinede[0m), 7 steps (e[36m2 skippede[0m, e[33m3 undefinede[0m, e[32m2 passede[0m)"=> nil Now I tried to gsub the string and...

MongoMapper logging to Rails log

I started playing around with MongoMapper for MongoDB and I have to say I’m loving it! Somehow it just feels so much easier to work with. However, I did have an issue with my code and needed to see whether or not MongoMapper was looking for account_id in my...

uninitialized constant Rails::Railtie

A few days ago my app just stopped working, after a quick google search I found a great site that explains why: Jamie van Dyke that pointed out that inherited_resources has now fully moved to Rails 3 and will no longer work on Rails 2.3 or lower. Now Jamie seems to...