How can I use a namespace in a Rake task dependency?

You already found the solution (name as a string).

You may extend this answer. There is no need to define namespaces and tasks with symbols. You can use Strings.

Doing this, you have the advantage of same type for definition and usage of task names.

Your example looks like this:

namespace 'demolition' do
  task 'fire_bazooka' do
    puts "kaboom!"
  end
end

task 'photograph_destruction' => "demolition:fire_bazooka" do
  puts "snapping pics! yay!"
end

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)