问题描述
我正在编写一个引擎,并且想在其中包含一个任务。 我写了我的文件.rake,总线未在rake --task中列出。如果我仍然尝试运行int,我会得到:
❯耙what2find:index
耙子流产了!不知道如何构建任务“ what2find:index”(请参见rake -T -A
可用任务列表)(通过使用--trace运行任务来查看完整跟踪)
我不明白为什么。
lib / tasks / what2find / index.rake
namespace :what2find do
desc "Indexes the configured entities"
task :index => :environment do
include What2find
# Task logic
end
end
Rakefile:
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
require 'rdoc/task'
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'What2find'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.md')
rdoc.rdoc_files.include('lib/**/*.rb')
end
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile",__dir__)
load 'rails/tasks/engine.rake'
load 'rails/tasks/statistics.rake'
# load 'lib/tasks/what2find_tasks.rake'
require 'bundler/gem_tasks'
require 'rake/testtask'
Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end
task default: :test
我的宝石的目录结构是:
.
├── app
│ ├── assets
│ │ ├── config
│ │ │ └── what2find_manifest.js
│ │ ├── images
│ │ │ └── what2find
│ │ └── stylesheets
│ │ └── what2find
│ │ └── application.css
│ ├── controllers
│ │ └── what2find
│ │ └── application_controller.rb
│ ├── helpers
│ │ └── what2find
│ │ └── application_helper.rb
│ ├── jobs
│ │ └── what2find
│ │ └── application_job.rb
│ ├── mailers
│ │ └── what2find
│ │ └── application_mailer.rb
│ ├── models
│ │ ├── index.rb
│ │ └── what2find
│ │ └── application_record.rb
│ └── views
│ └── layouts
│ └── what2find
│ └── application.html.erb
├── bin
│ └── rails
├── config
│ ├── initializers
│ │ └── what2find.rb.dist
│ └── routes.rb
├── Gemfile
├── Gemfile.lock
├── lib
│ ├── tasks
│ │ ├── test.rake
│ │ ├── what2find
│ │ │ └── index.rake
│ │ ├── what2find.rake
│ │ └── what2find_tasks.rake
│ ├── what2find
│ │ ├── engine.rb
│ │ └── version.rb
│ └── what2find.rb
├── MIT-LICENSE
├── Rakefile
├── README.md
├── test
│ ├── dummy
│ │ ├── app
│ │ │ ├── assets
│ │ │ │ ├── config
│ │ │ │ │ └── manifest.js
│ │ │ │ ├── images
│ │ │ │ └── stylesheets
│ │ │ │ └── application.css
│ │ │ ├── channels
│ │ │ │ └── application_cable
│ │ │ │ ├── channel.rb
│ │ │ │ └── connection.rb
│ │ │ ├── controllers
│ │ │ │ ├── application_controller.rb
│ │ │ │ └── concerns
│ │ │ ├── helpers
│ │ │ │ └── application_helper.rb
│ │ │ ├── javascript
│ │ │ │ └── packs
│ │ │ │ └── application.js
│ │ │ ├── jobs
│ │ │ │ └── application_job.rb
│ │ │ ├── mailers
│ │ │ │ └── application_mailer.rb
│ │ │ ├── models
│ │ │ │ ├── application_record.rb
│ │ │ │ └── concerns
│ │ │ └── views
│ │ │ └── layouts
│ │ │ ├── application.html.erb
│ │ │ ├── mailer.html.erb
│ │ │ └── mailer.text.erb
│ │ ├── bin
│ │ │ ├── rails
│ │ │ ├── rake
│ │ │ └── setup
│ │ ├── config
│ │ │ ├── application.rb
│ │ │ ├── boot.rb
│ │ │ ├── cable.yml
│ │ │ ├── database.yml
│ │ │ ├── environment.rb
│ │ │ ├── environments
│ │ │ │ ├── development.rb
│ │ │ │ ├── production.rb
│ │ │ │ └── test.rb
│ │ │ ├── initializers
│ │ │ │ ├── application_controller_renderer.rb
│ │ │ │ ├── assets.rb
│ │ │ │ ├── backtrace_silencers.rb
│ │ │ │ ├── content_security_policy.rb
│ │ │ │ ├── cookies_serializer.rb
│ │ │ │ ├── filter_parameter_logging.rb
│ │ │ │ ├── inflections.rb
│ │ │ │ ├── mime_types.rb
│ │ │ │ └── wrap_parameters.rb
│ │ │ ├── locales
│ │ │ │ └── en.yml
│ │ │ ├── puma.rb
│ │ │ ├── routes.rb
│ │ │ ├── spring.rb
│ │ │ └── storage.yml
│ │ ├── config.ru
│ │ ├── db
│ │ │ └── test.sqlite3
│ │ ├── lib
│ │ │ └── assets
│ │ ├── log
│ │ │ ├── development.log
│ │ │ └── test.log
│ │ ├── public
│ │ │ ├── 404.html
│ │ │ ├── 422.html
│ │ │ ├── 500.html
│ │ │ ├── apple-touch-icon.png
│ │ │ ├── apple-touch-icon-precomposed.png
│ │ │ └── favicon.ico
│ │ ├── Rakefile
│ │ ├── storage
│ │ └── tmp
│ │ ├── cache
│ │ │ └── assets
│ │ ├── development_secret.txt
│ │ ├── pids
│ │ └── storage
│ ├── integration
│ │ └── navigation_test.rb
│ ├── test_helper.rb
│ └── what2find_test.rb
└── what2find.gemspec
我的应用程序目录:
.
├── app
│ ├── assets
│ │ ├── config
│ │ │ └── manifest.js
│ │ ├── images
│ │ └── stylesheets
│ │ └── application.css
│ ├── channels
│ │ └── application_cable
│ │ ├── channel.rb
│ │ └── connection.rb
│ ├── connectors
│ │ ├── abstract_connector.rb
│ │ ├── claro_video.rb
│ │ ├── environment_variables.rb
│ │ ├── movistar_play.rb
│ │ └── netflix.rb
│ ├── controllers
│ │ ├── application_controller.rb
│ │ ├── concerns
│ │ └── content_controller.rb
│ ├── helpers
│ │ ├── application_helper.rb
│ │ ├── connectors_helper.rb
│ │ └── movistar_helper.rb
│ ├── javascript
│ │ ├── channels
│ │ │ ├── consumer.js
│ │ │ └── index.js
│ │ └── packs
│ │ └── application.js
│ ├── jobs
│ │ └── application_job.rb
│ ├── mailers
│ │ └── application_mailer.rb
│ ├── models
│ │ ├── concerns
│ │ └── content.rb
│ └── views
│ └── layouts
│ ├── application.html.erb
│ ├── mailer.html.erb
│ └── mailer.text.erb
├── babel.config.js
├── bin
│ ├── bundle
│ ├── rails
│ ├── rake
│ ├── setup
│ ├── spring
│ ├── webpack
│ ├── webpack-dev-server
│ └── yarn
├── config
│ ├── application.rb
│ ├── boot.rb
│ ├── cable.yml
│ ├── credentials.yml.enc
│ ├── environment.rb
│ ├── environments
│ │ ├── development.rb
│ │ ├── production.rb
│ │ └── test.rb
│ ├── initializers
│ │ ├── application_controller_renderer.rb
│ │ ├── assets.rb
│ │ ├── backtrace_silencers.rb
│ │ ├── content_security_policy.rb
│ │ ├── cookies_serializer.rb
│ │ ├── filter_parameter_logging.rb
│ │ ├── inflections.rb
│ │ ├── mime_types.rb
│ │ ├── what2find.rb
│ │ └── wrap_parameters.rb
│ ├── locales
│ │ └── en.yml
│ ├── master.key
│ ├── mongoid.yml
│ ├── puma.rb
│ ├── routes.rb
│ ├── spring.rb
│ └── webpacker.yml
├── config.ru
├── Gemfile
├── Gemfile.lock
├── lib
│ ├── assets
│ ├── request.rb
│ └── tasks
│ └── content.rake
├── log
│ └── development.log
├── package.json
├── postcss.config.js
├── public
│ ├── 404.html
│ ├── 422.html
│ ├── 500.html
│ ├── apple-touch-icon.png
│ ├── apple-touch-icon-precomposed.png
│ ├── favicon.ico
│ └── robots.txt
├── Rakefile
├── README.md
├── test
│ ├── application_system_test_case.rb
│ ├── channels
│ │ └── application_cable
│ │ └── connection_test.rb
│ ├── controllers
│ ├── fixtures
│ │ └── files
│ ├── helpers
│ ├── integration
│ ├── mailers
│ ├── models
│ ├── system
│ └── test_helper.rb
├── vendor
└── yarn.lock
有人可以说我做错了什么吗?
谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)