rubyist / guard-rake

guard-rake runs a rake task when files change
MIT License
94 stars 32 forks source link

Running rake tasks from a different gem? #42

Open Frexuz opened 7 years ago

Frexuz commented 7 years ago

I'm using https://github.com/redealumni/i18n_yaml_sorter

The gem has a rake task that is ran by rake i18n:sort, which works fine running manually

Guardfile

guard 'rake', task: 'i18n:sort' do
  watch(%r{^config/locales/.+\.yml})
end

But I'm getting an error

14:10:54 - INFO - Starting guard-rake i18n:sort
14:10:59 - INFO - running i18n:sort
14:10:59 - ERROR - Guard::Rake failed to run rake task <i18n:sort>, exception was:
> [#76a7d63a12cd]   RuntimeError: Don't know how to build task 'i18n:sort' (see --tasks)

rake --tasks shows

rake i18n:sort[path_to_file]            # Sort locales keys in alphabetic order

Ideas? :)