当前位置: 动力学知识库 > 问答 > 编程问答 >

ruby on rails - facing little trouble while executing test using rspec

问题描述:

whenever i run this command

spec spec/controllers/sample_controller_spec.rb

i get the following error

/Users/suman/.rvm/gems/[email protected]/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/[email protected]/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:106:in `rake_original_const_missing'

from /Users/suman/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing_not_from_s3_library'

from /Users/suman/.rvm/gems/[email protected]/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing'

from /Users/suman/.rvm/gems/[email protected]/gems/rspec-1.3.1/lib/spec/runner/options.rb:314:in `plugin_mock_framework'

from /Users/suman/.rvm/gems/[email protected]/gems/rspec-1.3.1/lib/spec/runner/options.rb:139:in `run_examples'

from /Users/suman/.rvm/gems/[email protected]/gems/rspec-1.3.1/lib/spec/runner/command_line.rb:9:in `run'

from /Users/suman/.rvm/gems/[email protected]/gems/rspec-1.3.1/bin/spec:5

from /Users/suman/.rvm/gems/[email protected]/bin/spec:19:in `load'

from /Users/suman/.rvm/gems/[email protected]/bin/spec:19

from /Users/suman/.rvm/gems/[email protected]/bin/ruby_noexec_wrapper:14

my gemfile looks like this

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

Can any one help me in solving this issue i am using rails 2.3.14

网友答案:

I was working all the day for solving this error and finally it worked when i changed the mocha version in gemfile from

 gem "mocha", "~> 0.13.3"

to

gem "mocha", "~> 0.12.8"
分享给朋友:
您可能感兴趣的文章:
随机阅读: