Rake里面的任务没有被发现 [英] Rake tasks inside gem not being found

查看:117
本文介绍了Rake里面的任务没有被发现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实施了 edebill / 19224>他的回答,以这个问题

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

如果我以通常的方式指向gem,并将其安装在我的环境中,那么就可以使用

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

gem 'activerecord_datawarehouse'

rake -T不显示我的rake任务,但是如果我直接指向到宝石源代码,如

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"

它显示并完成任务。

我在这里可能会错过什么?我做了双重检查,并且安装的gem与我在源代码中的相同。

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

推荐答案

修复了我的问题。在gemspec中,您还需要包含rake任务文件,而不仅仅是lib文件:

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']


$ b

使用:

Use:

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

这篇关于Rake里面的任务没有被发现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆