Ricardo Acras
Ricardo Acras

Reputation: 36254

Rake tasks inside gem not being found

I have implemented what edebill suggested in his answer to this question.

If I point to the gem in the usual way, with it installed in my environment

gem 'activerecord_datawarehouse'

rake -T does not show my rake tasks, but if I point directly to the gem source code, like

gem 'activerecord_datawarehouse', :path => "/home/acras/code/activerecord_datawarehouse"

It shows and rake tasks work perfectly.

What could I be missing here? I did double checked and the installed gem is the same that I have in the source code.

Upvotes: 2

Views: 1093

Answers (1)

platforms
platforms

Reputation: 2726

Fixed it on my end. In the gemspec, you need to include the rake tasks files as well, not just the lib files:

Instead of:

  s.files = Dir['lib/**/*.rb']

Use:

  s.files = Dir['lib/**/*.rb'] + Dir['tasks/*.rake']

Upvotes: 6

Related Questions