`rspec --configure autotest` throws "uninitialized constant Class::FileUtils"
I'm trying to setup autotest with RSpec. Never had a problem before, but when I run rspec --configure autotest
, I get the following error/trace:
Autotest loads RSpec's Autotest subclass when there is a .rspec file in the project's root directory.
/Users/brennon/.rvm/gems/ruby-1.9.2-p0@timekeepa/gems/rspec-core-2.5.1/lib/rspec/core/backward_compatibility.rb:20:in `const_missing': uninitialized constant Class::FileUtils (NameError)
from /Users/brennon/.rvm/gems/ruby-1.9.2-p0@timekeepa/gems/rspec-core-2.5.1/lib/rspec/core/command_line_configuration.rb:38:in `create_dot_rspec_file'
from /Users/brennon/.rvm/gems/ruby-1.9.2-p0@timekeepa/gems/rspec-core-2.5.1/lib/rspec/core/command_line_configuration.rb:29:in `generate'
from /Users/brennon/.rvm/gems/ruby-1.9.2-p0@timekeepa/gems/rspec-core-2.5.1/lib/rspec/core/command_line_configuration.rb:12:in `run'
from /Users/brennon/.rvm/gems/ruby-1.9.2-p0@timekeepa/gems/rspec-core-2.5.1/lib/rspec/core/option_parser.rb:101:in `block (2 levels) in parser'
from /Users/brennon/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/optparse.rb:1277:in `call'
from /Users/brennon/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/optparse.rb:1277:in `block in parse_in_order'
from /Users/brennon/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/optparse.rb:1264:in `catch'
from /Users/brennon/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/optparse.rb:1264:in `parse_in_order'
from /Users/brennon/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/optparse.rb:1258:in `order!'
from /Users/brennon/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/optparse.rb:1349:in `permute!'
from /Users/brennon/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/optparse.rb:1370:in `parse!'
from /Users/brennon/.rvm/gems/ruby-1.9.2-p0@timekeepa/gems/rspec-core-2.5.1/lib/rspec/core/option_parser.rb:18:in `parse!'
from /Users/brennon/.rvm/gems/ruby-1.9.2-p0@timekeepa/gems/rspec-core-2.5.1/lib/rspec/core/option_parser.rb:4:in `parse!'
from /Users/brennon/.rvm/gems/ruby-1.9.2-p0@timekeepa/gems/rspec-core-2.5.1/lib/rspec/core/configuration_options.rb:88:in `command_line_options'
from /Users/brennon/.rvm/gems/ruby-1.9.2-p0@timekeepa/gems/rspec-core-2.5.1/lib/rspec/core/configuration_options.rb:122:in `custom_options_file'
from /Users/brennon/.rvm/gems/ruby-1.9.2-p0@timekeepa/gems/rspec-core-2.5.1/lib/rspec/core/configuration_options.rb:65:in `parse_options'
from /Users/brennon/.rvm/gems/ruby-1.9.2-p0@timekeepa/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:41:in `run'
from /Users/brennon/.rvm/gems/ruby-1.9.2-p0@timekeepa/ge开发者_如何学JAVAms/rspec-core-2.5.1/lib/rspec/core/runner.rb:10:in `block in autorun'
Simply running rspec
runs just fine, and running autotest
runs fine as well, but only loads Cucumber features. Also, require 'fileutils'
returns true in irb. Any ideas?
I'm not sure why, and it seems like this can't be the correct solution, but deleting and recreating the .rspec
file solved the problem.
精彩评论