rakefile aborted不知道如何构建任务宝石

时间:2017-03-07 11:20:06

标签: ruby-on-rails rubygems rake rakefile

我正在尝试使用Ruby安装程序。 但现在我陷入了这个错误:

  

rake文件已中止。不知道如何构建任务宝石

有人可以帮助我吗?

Rake文件如下所示:

# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)
require 'rake'

require 'rake/testtask'
require 'rdoc/task'
#require 'tasks/rails'

SkWeb::Application.load_tasks

1 个答案:

答案 0 :(得分:0)

我认为你需要文件

Dir.glob('lib/tasks/*.rake').each { |r| load r}

您的代码将是

# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)
require 'rake'
Dir.glob('lib/tasks/*.rake').each { |r| load r} 
require 'rake/testtask'
require 'rdoc/task'
#require 'tasks/rails'

SkWeb::Application.load_tasks