MustModify Blog: Recent Posts

Funniest irrelevant argument ever

May 22, 2011
From "Use Mercurial, you Git!": "If I'd wanted building blocks for rolling my own, I'd have gone to Home Depot and bought a 1 and a 0."

MySQL permissions for a Rails app

May 21, 2011
Here's how I typically setup my rails environments. NOTE: I don't include stored procedure or view permissions because Rails doesn't ever use those. Wouldn't it be great if Rails used views or stored procedures? Actually, I kinda like it the way it is. Stored Procedures are nice but the tradeoff, IE having business logic in the app and in the...

Capistrano says, "sh: bundle: not found"

May 12, 2011
Typically, you define your path in /etc/environment. Here's a simple example: --- PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ruby/bin" --- That last bit tells the system where Ruby lives. If Ruby isn't in the path, you won't be able to run it or any gem scripts, like bundle. Unfortunately,...

[FIX] With Rails 2.3.x, undefined local variable or method `dep' for Gem:Module

April 20, 2011
I received this message when I ran cucumber tests but not when I used script/console. Kinda strange. Perhaps this is because I didn't configure cucumber for my dev environment?? Anyway, the fix: --- gem uninstall rubygems-update gem update --system 1.4.3 --- In the words of Yoda, "Unfortunate this is, and unexpected." References ======= "Can...

get Ruby 1.9 Date.parse to assume American date format

March 29, 2011
Ruby 1.9 assumes that everyone has been broken of the bad habit of illogical date formats. in the console: --- >> Date.parse('2/15/2011') ArgumentError: invalid date >> Date.parse('2/15/11') ArgumentError: invalid date >> '2/15/2011'.to_date ArgumentError: invalid date --- While I'm driving everyone crazy by...

My Rails App Just Answered the Phone?

March 17, 2011
"Twilio": apparently offers a "telephone api": and also an SMS API. I get how you could easily set up an SMS API. Pretty cool stuff. But what amazed me what the idea that someone could call a telephone number, which would result in a post to my website... and I would respond with...

Cucumber via Envjs says "a.ownerDocument is null"

March 10, 2011
I recently received the following errors when running capybara with envjs. Strangely, there was a kind of double stack trace. Here are the exeptions: === WARNIING: {ENVJS} Exception while dispatching events: a.ownerDocument is null a.ownerDocument is null (Johnson::Error) === === WARNIING: {ENVJS} Exception while...

Ask Cucumber with Capybara for inline HTML... now with CSS Selectors!

January 18, 2011
Two very useful cucumber steps: --- Then 'display the page' do puts "\n\n\n#{page.body.to_s}\n\n\n" end Then /^display "(*)"$/ do |selector| puts "\n\n\n#{find(selector).native.to_html}\n\n\n" end --- When you're remoting in to your dev machine, you can't use "Then show me the page" because there is no desktop in which to open...