2015-11-18 136 views
0

這個問題和答案可能很簡單,但我認爲這將是值得分享的。運行Rspec測試用例時Gem :: ConflictError

我克隆了github存儲庫https://github.com/mikel/mail.git並瀏覽了規格。

我只是想在應用程序內運行規格,所以運行命令「rspec」。

錯誤描述

[email protected] mail (master) $ rspec 
Running Specs under Ruby Version 2.1.5 
/Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:2104:in `raise_if_conflicts': Unable to activate rspec-3.3.0, because rspec-core-3.4.0 conflicts with rspec-core (~> 3.3.0) (Gem::ConflictError) 
    from /Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1282:in `activate' 
    from /Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems.rb:198:in `rescue in try_activate' 
    from /Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems.rb:195:in `try_activate' 
    from /Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `rescue in require' 
    from /Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:39:in `require' 
    from /Users/athi/Documents/apps/github/mail/spec/spec_helper.rb:18:in `<top (required)>' 
    from /Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require' 
    from /Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require' 
    from /Users/athi/Documents/apps/github/mail/spec/mail/attachments_list_spec.rb:2:in `<top (required)>' 
    from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/configuration.rb:1361:in `load' 
    from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files' 
    from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/configuration.rb:1359:in `each' 
    from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/configuration.rb:1359:in `load_spec_files' 
    from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/runner.rb:102:in `setup' 
    from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/runner.rb:88:in `run' 
    from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/runner.rb:73:in `run' 
    from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/runner.rb:41:in `invoke' 
    from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/exe/rspec:4:in `<top (required)>' 
    from /Users/athi/.rvm/gems/ruby-2.1.5/bin/rspec:23:in `load' 
    from /Users/athi/.rvm/gems/ruby-2.1.5/bin/rspec:23:in `<main>' 
    from /Users/athi/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval' 
    from /Users/athi/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>' 

回答

1

一點搜索,我發現了「捆綁」將不會被初始化爲這個倉庫和Gemfile.lock的丟失之後。

所以我只是跑

捆綁安裝

和它的工作。

它安裝了必要的寶石,然後我能夠正確運行規格。