1

每当我运行这个命令

spec spec/controllers/sample_controller_spec.rb

我收到以下错误

/Users/suman/.rvm/gems/ruby-1.8.7-p357@helpkit3/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:466:in `load_missing_constant': uninitialized constant Spec::Adapters (NameError)
    from /Users/suman/.rvm/gems/ruby-1.8.7-p357@helpkit3/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:106:in `rake_original_const_missing'
    from /Users/suman/.rvm/gems/ruby-1.8.7-p357@helpkit3/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing_not_from_s3_library'
    from /Users/suman/.rvm/gems/ruby-1.8.7-p357@helpkit3/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing'
    from /Users/suman/.rvm/gems/ruby-1.8.7-p357@helpkit3/gems/rspec-1.3.1/lib/spec/runner/options.rb:314:in `plugin_mock_framework'
    from /Users/suman/.rvm/gems/ruby-1.8.7-p357@helpkit3/gems/rspec-1.3.1/lib/spec/runner/options.rb:139:in `run_examples'
    from /Users/suman/.rvm/gems/ruby-1.8.7-p357@helpkit3/gems/rspec-1.3.1/lib/spec/runner/command_line.rb:9:in `run'
    from /Users/suman/.rvm/gems/ruby-1.8.7-p357@helpkit3/gems/rspec-1.3.1/bin/spec:5
    from /Users/suman/.rvm/gems/ruby-1.8.7-p357@helpkit3/bin/spec:19:in `load'
    from /Users/suman/.rvm/gems/ruby-1.8.7-p357@helpkit3/bin/spec:19
    from /Users/suman/.rvm/gems/ruby-1.8.7-p357@helpkit3/bin/ruby_noexec_wrapper:14

我的 gemfile 看起来像这样

group :test do
   gem "rspec", "1.3.1"
   gem "rspec-rails", "1.3.3"
   gem "spork", "~> 0.8.0"
   gem "mocha", "~> 0.13.3"
end

任何人都可以帮助我解决这个问题我正在使用 rails 2.3.14

4

1 回答 1

0

我整天都在努力解决这个错误,最后当我将 gemfile 中的 mocha 版本从

 gem "mocha", "~> 0.13.3"

gem "mocha", "~> 0.12.8"
于 2013-05-17T14:57:36.500 回答