加载' teamcity'时出错运行`Cucumber ./features`

时间:2017-07-31 14:48:42

标签: ruby-on-rails testing cucumber

目前,我正在尝试使用Cucumber在Ruby on Rails应用程序中运行测试。

cucumber ./features --tags ~@javascript

每当我运行此命令时,我都会收到与teamcity

相关的以下错误
Using the default profile...
cannot load such file -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError)

我已尝试使用其他相关问题中提供的解决方案,但似乎无法使其发挥作用,除非有我缺少的东西。

版本

  • Ruby 2.0.0p648(2015-12-16修订版53162)

  • Rails 3.2.21

  • Ubuntu 16.04

完全错误

cannot load such file -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError)
/home/d/dev/sareform/features/support/env.rb:22:in `require'
/home/d/dev/sareform/features/support/env.rb:22:in `block in <top (required)>'
/home/d/.rvm/gems/ruby-2.0.0-p648/gems/spork-1.0.0rc4/lib/spork.rb:24:in `prefork'
/home/d/dev/sareform/features/support/env.rb:4:in `<top (required)>'
/home/d/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in `load'
/home/d/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in `load_code_file'
/home/d/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:171:in `load_file'
/home/d/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/home/d/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in `each'
/home/d/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/home/d/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:175:in `load_step_definitions'
/home/d/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:40:in `run!'
/home/d/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:43:in `execute!'
/home/d/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:20:in `execute'
/home/d/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-1.2.1/bin/cucumber:14:in `<top (required)>'
/home/d/.rvm/gems/ruby-2.0.0-p648/bin/cucumber:23:in `load'
/home/d/.rvm/gems/ruby-2.0.0-p648/bin/cucumber:23:in `<main>'
/home/d/.rvm/gems/ruby-2.0.0-p648/bin/ruby_executable_hooks:15:in `eval'
/home/d/.rvm/gems/ruby-2.0.0-p648/bin/ruby_executable_hooks:15:in `<main>'

的Gemfile

gem 'rails', '3.2.21'
gem 'rake', '10.4.2' 
....

gem 'jquery-rails'#, "3.1.2" #old version 1.0.19
gem 'jquery-ui-rails'
gem 'rvm'
gem 'rvm-capistrano',  require: false
....
gem 'coffeebeans'
....
gem 'nokogiri', '>= 1.6'
gem 'custom_configuration', '~> 0.0.2'

group :test, :test_ram do
  gem 'cucumber'
  gem 'cucumber-rails', :require => false
  gem 'timecop'
  gem 'guard-zeus'
  gem 'kaminari-rspec'
end

group :cucumber, :test, :test_ram do
  gem 'i18n'
  gem "rack"
  gem 'rack-test'
  gem 'capybara'
  gem 'database_cleaner'
  gem 'rb-inotify'#, '~> 0.9'
  gem 'libnotify'
  gem 'ffi', '>= 1.0.11'
  gem "factory_girl_rails" #was 1.6.0
  gem "guard"#, "~> 1.1.0"#was 0.10.0
  gem "guard-rspec"
  gem "guard-livereload"
  gem "guard-cucumber", "~>1.2.2" #was 0.7.5
  gem "guard-bundler"
  gem 'guard-webrick', "~> 0.1.2" #was 0.1.0
  gem 'guard-test'
  gem 'spork', '> 0.9.0.rc'
  gem 'guard-spork'
  gem 'selenium-client'
  gem "selenium-webdriver", "~> 2.45.0"
  gem 'cucumber_statistics'
end


group :development, :test, :test_ram do
  gem 'email_spec'
#  gem 'mocha'#was 0.10.4
  gem 'webrat'
  gem 'rspec-rails' #was 2.8.0
  gem "rspec-activemodel-mocks"
  gem "launchy", '~> 2.1.0' #previously no version identified
  gem "geordi"
  gem 'rb-fsevent'
  gem "zeus"
  gem "parallel_tests"
  gem 'zeus-parallel_tests'
  gem 'jasmine'
  gem 'jasmine-sinon-rails'
  gem 'jasmine-jquery-rails'
end

1 个答案:

答案 0 :(得分:0)

在我看来,好像你的道路被打破了。你有一个相对路径,我认为TeamCity不会像你想象的那样使用相同的项目根。

我的方法是从绝对路径开始。让系统运行,然后查看是否可以使用相对路径。