Ruby Rake从gem中加载任务

我一直在尝试将位于github上的gem添加到我当前的应用程序中。 gem有一个rake文件,我希望能够从我的应用程序访问。 但我不断加载错误。

load 'tasks/deploy.rake' 

gem文件看起来像那样

 # -*- encoding: utf-8 -*- require 'rake' Gem::Specification.new do |gem| gem.authors = %w(Hello World) gem.email = %w(test@example.com) gem.description = 'test' gem.summary = 'test' gem.homepage = 'https://github.com/..' gem.files = FileList[ 'lib/**/*.rb', 'tasks/deploy.rake', 'README.md' ].to_a gem.name = 'test' gem.require_paths = %w(lib) gem.version = '0.0.1' end 

我希望能够将./tasks/deploy.rake加载到包含此gem的应用程序中,我该如何继续呢?

谢谢

好的,如果有人有兴趣,我找到了解决这个问题的方法:

 # Rails.root/Rakefile spec = Gem::Specification.find_by_name 'test' load "#{spec.gem_dir}/tasks/deploy.rake" 

这就是我在Rakefile中需要说的全部内容!