chanzuckerberg / sorbet-rails

A set of tools to make the Sorbet typechecker work with Ruby on Rails seamlessly.
MIT License
638 stars 85 forks source link

Don't know how to build task 'rails_rbi:routes' #447

Closed Cohen-Carlisle closed 3 years ago

Cohen-Carlisle commented 3 years ago

Describe the bug: This bug occurs when you try to run namespaced rake tasks that invoke other rake tasks. For instance, if you have a rails engine, rake app:rails_rbi:all and rake app:rails_rbi:custom fail when trying to invoke other tasks because they don't account for the namespacing:

% bundle exec rake app:rails_rbi:all
rake aborted!
Don't know how to build task 'rails_rbi:routes' (See the list of available tasks with `rake --tasks`)

Steps to reproduce: Create a rails app with namespaced sorbet-rails rake tasks (for instance by using an engine) and run either rake app:rails_rbi:all or rake app:rails_rbi:custom.

Expected behavior: The tasks should be executed within the namespace and complete.

Versions:

hdoan741 commented 3 years ago

Thank you @Cohen-Carlisle for reporting and fixing this bug!