Scott Watermasysk

Still Learning to Code

ZSH and Rake Parameters

I wanted to pass a parameter into a rake task which uses a format like this:

task :name, :first do  |t, args|
  puts "Hello #{args[:first]}"

To execute the task:

rake name[Scott]

However, I kept getting an error that ZSH could not find the command. It turns out, I was tripping over ZSH’s globbing feature.

Thankfully, adding a simple alias resolved the issue for me:

alias rake='noglob rake'

I probably wasted an hour trying to figure out why ZSH didn’t like my rake task. Hopefully this post saves you from doing the same.