2016-01-11 21 views
5

このソリューションは、私と一緒に動作しません:RSpecの:そのようなファイルをロードすることはできません - チームシティー/スペック/ランナー/フォーマッタ/チームシティー/フォーマッタ(とLoadError)

Running a spec in RubyMine results in "cannot load such file -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError)"

だけでなく、この記事:

私はUbuntuの15.10、ルビーマイン7.1、Rubyの2.2.3使用してい

https://www.jetbrains.com/ruby/help/using-rspec-in-rails-applications.html

は、

4.2.5は、私はそれがエラーを返すだRun 'spec:projectでRSpecのを開始しようとしているときにレール:

01私はターミナルで $ bundle exec rspecをrunnigてる場合
/home/duke/.rvm/rubies/ruby-2.2.3/bin/ruby -I/home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib:/home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-support-3.4.1/lib /home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb 
/home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1295:in `require': cannot load such file -- teamcity/spec/runner/formatter/teamcity/formatter (LoadError) 
    from /home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1295:in `block in requires=' 
    from /home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1295:in `each' 
    from /home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1295:in `requires=' 
    from /home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration_options.rb:109:in `block in process_options_into' 
    from /home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration_options.rb:108:in `each' 
    from /home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration_options.rb:108:in `process_options_into' 
    from /home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/configuration_options.rb:21:in `configure' 
    from /home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:101:in `setup' 
    from /home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:88:in `run' 
    from /home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:73:in `run' 
    from /home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:41:in `invoke' 
    from /home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/exe/rspec:4:in `<main>' 
/home/duke/.rvm/rubies/ruby-2.2.3/bin/ruby -I/home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib:/home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-support-3.4.1/lib /home/duke/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed 

Process finished with exit code 1 

同じ時間は、出力は次のようになります。それはすべて私のために奇妙なので

No examples found. 


Finished in 0.00029 seconds (files took 2.21 seconds to load) 
0 examples, 0 failures 

私は、テストで全く新たなんです。宝石がインストールされているので、

group :development, :test do 
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console 
    gem 'byebug' 
    gem 'rspec-rails' 
    #gem 'factory_girl' 
    #gem 'ffaker' 
    #gem 'shoulda-matchers' 
    #gem 'pry-byebug' 
end 

とRAN bundle install

UPD:

. 
├── lib 
│   └── destroy_user_spec.rb 
├── rails_helper.rb 
└── spec_helper.rb 

はGemfileでは、私が追加: .rspec

--color 
--require spec_helper 

マイspecフォルダかなり空です。

UPD2:私のテストでは、 'spec 'destroy_user_spec.rb''を実行すると正常に動作します。解決

+1

プロジェクトのルートフォルダに '.rspec'ファイルがある場合はそれを共有し、' spec'フォルダの内容を共有してください。また、スペック関連の宝石が追加された後で 'bundle'が実行されていることを確認してください。 – mudasobwa

+1

これは[この春のプリローダーとRubyMineに関連するこの質問の複製です](http://stackoverflow.com/questions/24525945/running-a-spec-in-rubymine-results-in-cannot-load-such- file-teamcity-spec-ru)、そして[これは実際の修正です](http://stackoverflow.com/a/36757377/25192)、上記の受け入れられた答えではありません。 – thewoolleyman

+0

元の質問と必ずしも春とは関係がないと思います – aceofspades

答えて

5

:私はちょうどこの記事を見rails g rspec:install

みんなの後にルビーマインを再起動しなければならなかった、私をdownvoteして自由に感じます。

+1

これは「春のプリローダーとRubyMineに関連するこの質問」の複製です(http://stackoverflow.com/questions/24525945/running-a-spec -in-rubymine-results-in-can-load-such-file-teamcity-spec-ru)、[これは実際の修正です](http://stackoverflow.com/a/36757377/25192)ではなく、上記の回答を受け入れました。 – thewoolleyman

+0

元の質問は必ずしも春とは関係ないと思います – aceofspades

関連する問題