当我以编程方式运行rspec时(RSpec :: Core :: Runner.run(['spec / apis / my_spec.rb']))我得到了宝石遗漏错误。
/usr/local/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:308:in `to_specs': Could not find 'em-synchrony' (>= 1.0.0) among 175 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/root/.gem/ruby/2.1.0:/usr/local/lib/ruby/gems/2.1.0:/usr/local/bundle', execute `gem env` for more information
但是当我使用rspec命令运行规范时,它的工作正常。
rspec --pattern spec / apis / my_spec.rb --format nested
提前致谢。