为什么缺少一些 rake 任务?
我的 rake -T
清单中缺少所有 db:test:*
rake 任务,但我仍然能够正常调用它们。什么可能导致这种情况?
All of the db:test:*
rake tasks are missing from my rake -T
listing, but I am still able to call them normally. What could cause this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
显然,Rails 团队认为 rake -T 给出了太多输出;许多 Rake 任务的描述都被注释掉了。请参阅 https://github.com/rails/rails/commit/29acc17 和 https://github.com/rails/rails/commit/9838156 示例(其中包括来自
db:test:*
的一些任务)。Apparently the Rails team decided that
rake -T
gave too much output; many of the descriptions of the Rake tasks are commented out. See https://github.com/rails/rails/commit/29acc17 and https://github.com/rails/rails/commit/9838156 for an example (which includes some tasks fromdb:test:*
).我觉得他们也可以单独切换来列出所有命令。但在完成之前,我建议使用rake -P,因为它将列出所有可用的命令及其依赖项(遗憾的是没有描述),这有点过头了。如果您使用的是类似 Linux 的操作系统,那么在列表中使用 grep 将为您提供更精确的列表。
I feel that they could have made a separate switch for listing all commands as well. But until that is done, I recommend using rake -P as it will list all the available commands and their dependencies -sadly without descriptions-, which is a bit overdoing the job. If you are on Linux like OS then using grep on the list will give you a more refined list.