ruby-on-rails – 运行rspec时对’circular require’的太多警告

嗨,我有很多警告,当运行rspec这使我太烦人了,

如何解决?因为我在rbenv下试过Ruby版本2.1.2,但它根本没有工作。

这是我的Gemfile

source 'https://rubygems.org'

gem 'bootstrap-sass'
gem 'coffee-rails'
gem 'rails'
gem 'haml-rails'
gem 'sass-rails'
gem 'uglifier'
gem 'jquery-rails'

group :development do
  gem 'sqlite3'
  gem 'pry'
  gem 'pry-nav'
  gem 'thin'
  gem "better_errors"
  gem "binding_of_caller"
end

group :test, :development do
    gem 'rspec-rails'
end

group :production do
  gem 'pg'
  gem 'rails_12factor'
end
gem 'hirb'
gem 'crack'
gem 'ap'
gem 'awesome_print'

# gem 'faker'

警告meassages

% rspec                                                                                                                                             (git)-[feature/w1_test_the_video_model] 
nil
/Users/jeff/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/bootstrap-sass-3.1.1.1/lib/bootstrap-sass/sass_functions.rb:20: warning: ambiguous first argument; put parentheses or even spaces
/Users/jeff/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/sass-3.2.19/lib/sass/version.rb:5: warning: loading in progress, circular require considered harmful - /Users/jeff/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/sass-3.2.19/lib/sass.rb
    from /Users/jeff/.rbenv/versions/2.0.0-p481/bin/rspec:23:in `<main>'
    from /Users/jeff/.rbenv/versions/2.0.0-p481/bin/rspec:23:in `load'
    from /Users/jeff/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.0/exe/rspec:4:in `<top (required)>'
    from /Users/jeff/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.0/lib/rspec/core/runner.rb:38:in `invoke'
    from /Users/jeff/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.0/lib/rspec...
我有同样的错误,并修复它引用的页面。

Guard with RSpec on Rails 4 giving a lot of warnings

the --warnings option in the .rspec file by default. Remove that line, and the warnings will go away.

http://stackoverflow.com/questions/24072876/too-many-warnings-about-circular-require-when-run-rspec

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:ruby-on-rails – 运行rspec时对’circular require’的太多警告