web-dev-qa-db-ja.com

Rspec / Capybaraの読み込みが進行中、循環は有害と見なされる必要があります

これがカピバラの問題かどうかは不明ですが、Rails(4.1.1)とRspec Rails(3.0.1)の新規インストールを実行しただけで、 Capybara(2.3.0)を使用したいのですが、使用したことがなく、問題が発生しています。-spec/featuresに「仕様」を作成しました。仕様自体が期待どおりに実行され、渡されます。 rspecを実行すると、次の「警告」が表示されます。アイデアはありますか?Rubyレベルなどで警告を無効にする必要がありますか?

/Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/mail-2.5.4/lib/mail/network/delivery_methods/sendmail.rb:53: warning: shadowing outer local variable - to
/Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247: warning: loading in progress, circular require considered harmful - /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/capybara-2.3.0/lib/capybara.rb
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/bin/Ruby_executable_hooks:15:in  `<main>'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/bin/Ruby_executable_hooks:15:in  `eval'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/bin/rspec:23:in  `<main>'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/bin/rspec:23:in  `load'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/rspec-core-3.0.0/exe/rspec:4:in  `<top (required)>'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:38:in  `invoke'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:70:in  `run'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:85:in  `run'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:97:in  `setup'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/configuration.rb:1051:in  `load_spec_files'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/configuration.rb:1051:in  `each'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/configuration.rb:1051:in  `block in load_spec_files'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/rspec-core-3.0.0/lib/rspec/core/configuration.rb:1051:in  `load'
    from /Users/typeoneerror/Dev/Doki/engines/doki_core/spec/features/accounts/sign_up_spec.rb:1:in  `<top (required)>'
    from /Users/typeoneerror/Dev/Doki/engines/doki_core/spec/features/accounts/sign_up_spec.rb:1:in  `require'
    from /Users/typeoneerror/Dev/Doki/engines/doki_core/spec/Rails_helper.rb:7:in  `<top (required)>'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in  `load_dependency'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `block in require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/rspec-Rails-3.0.1/lib/rspec/Rails.rb:9:in  `<top (required)>'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in  `load_dependency'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `block in require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/rspec-Rails-3.0.1/lib/rspec/Rails/vendor/capybara.rb:2:in  `<top (required)>'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in  `load_dependency'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `block in require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/capybara-2.3.0/lib/capybara/rspec.rb:1:in  `<top (required)>'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in  `load_dependency'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `block in require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/capybara-2.3.0/lib/capybara.rb:5:in  `<top (required)>'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/capybara-2.3.0/lib/capybara.rb:320:in  `<module:Capybara>'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in  `load_dependency'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `block in require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/capybara-2.3.0/lib/capybara/dsl.rb:1:in  `<top (required)>'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in  `load_dependency'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `block in require'
    from /Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in  `require'
/Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/capybara-2.3.0/lib/capybara/node/matchers.rb:121: warning: assigned but unused variable - e
/Users/typeoneerror/.rvm/gems/Ruby-2.1.2@doki/gems/capybara-2.3.0/lib/capybara/Selenium/driver.rb:119: warning: assigned but unused variable - a
41
typeoneerror

削除する --warningsから.rspec。 rspec 3.0.0のジェネレーターにはこの設定が含まれていましたが、これは間違いであることに気づきました。ユーザーに警告のないコードを書くように促すのは良いことですが、ユーザーが理由を確認せずにこれらの警告を受け取るのは混乱します。

詳細:

https://github.com/rspec/rspec-core/issues/1571

95
Myron Marston