travis无法使用LoadError运行rake:无法加载此类文件 - rspec / core / rake_task

时间:2016-03-24 15:58:14

标签: ruby rspec travis-ci

让我先说一下这一切都在本地运行并成功。

错误:

$ rake
rake aborted!
LoadError: cannot load such file -- rspec/core/rake_task
/home/travis/build/alienfast/gulp-pipeline-rails/Rakefile:4:in `<top (required)>'
/home/travis/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
/home/travis/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)

.travis.yml

language: ruby
rvm:
  - 2.2.2
  - ruby-head

matrix:
  allow_failures:
    - rvm: ruby-head

cache: bundler

before_script:
  # install Gulp 4 CLI tools globally from 4.0 GitHub branch
  - npm install gulpjs/gulp-cli#4.0 -g

script: rake

的Gemfile

gemspec


# travis-ci quirk?
group :development, :test do
  gem 'rake'
  gem 'rspec'
  gem 'rspec-rails'
  gem 'capybara'
  gem 'capybara-webkit'
end

修复尝试:

  • 在本地,我已经清空了我的rvm gemset,删除了锁,并复制了travis构建 - 仍然有效
  • 我尝试将必要的测试宝石从gemspec移到Gemfile

所以我很困惑,我有其他项目没有这个问题,我没有看到任何明显的东西。有没有理由得到LoadError: cannot load such file -- rspec/core/rake_task

1 个答案:

答案 0 :(得分:0)

您是否尝试使用bundle exec rake -t如此处所述LoadError: cannot load such file -- rspec/core/rake_task