Rake测试无法在Rails应用程序中运行

时间:2016-07-15 18:18:09

标签: ruby-on-rails ruby rake

我正在尝试在我的rails库应用中运行Minitests,当我运行rake test时,我收到错误LoadError: cannot load such file -- rake/testtask

这是我的rakefile:

require "bundler"
Bundler.setup

require 'rake/testtask'

desc 'Test the library.'
Rake::TestTask.new(:test) do |t|
  t.libs << 'lib' << 'test'
  t.pattern = 'test/**/*_test.rb'
  t.verbose = true
end

以下是我的gemfile:

source 'https://rubygems.org'

gemspec

gem 'minitest'
gem 'htmlentities'
gem 'aws-s3'
gem 'byebug', platforms: :mri
gem 'rake'

1 个答案:

答案 0 :(得分:0)

没有加载耙子。将gem 'rake'添加到您的Gemfile