Search code examples
rubycommand-linethor

Script error message: "Could not find command in namespace"


I've put this into my Foo.thor:

class Foo < Thor
  desc 'hello', 'prints hello'
  def hello
    puts 'hello'
  end
end

Foo.start(ARGV)

but when executing 'thor foo:hello' i get this error message:

Could not find command "foo:hello" in "foo" namespace.

together with the output 'hello'

So that 'hello' output seems correct but the error message the line before makes me wonder, if something is wrong.

Can i get rid of that error message?


Solution

  • Do not use Foo.start(ARGV) in the file. You don't need this line.