Ruby on rails 轨道5+;显示Rails CLI中的所有自定义Rake任务

Ruby on rails 轨道5+;显示Rails CLI中的所有自定义Rake任务,ruby-on-rails,ruby-on-rails-5,Ruby On Rails,Ruby On Rails 5,在Rails 5+中,如何显示来自RailsCLI的所有定制Rake任务?在Rails 5之前,所有Rake任务(包括自定义任务)都将显示为Rake-T。在Rails 5及更高版本中,所有rake命令都被Rails替换。因此,rails-T自然会列出可用的rails命令。但是,它没有列出我的项目的自定义Rake任务,即使通过railsCLI运行该任务仍能正常工作。命令: namespace :db do desc 'Drop, create, migrate then seed the de

在Rails 5+中,如何显示来自
Rails
CLI的所有定制Rake任务?在Rails 5之前,所有Rake任务(包括自定义任务)都将显示为
Rake-T
。在Rails 5及更高版本中,所有
rake
命令都被
Rails
替换。因此,
rails-T
自然会列出可用的rails命令。但是,它没有列出我的项目的自定义Rake任务,即使通过
rails
CLI运行该任务仍能正常工作。

命令:

namespace :db do
  desc 'Drop, create, migrate then seed the development database'
  task database: [ 'db:drop', 'db:create', 'db:migrate', 'db:seed' ] do
    exec ('bundle install')
    puts 'Datebase Remigrated.'
  end
end
rails-vT

示例:

namespace :db do
  desc 'Drop, create, migrate then seed the development database'
  task database: [ 'db:drop', 'db:create', 'db:migrate', 'db:seed' ] do
    exec ('bundle install')
    puts 'Datebase Remigrated.'
  end
end

你的任务有描述吗?尝试使用
rails-T-A
。实际上
rails-vT