2011-10-24 71 views
0

我是新來的Rails和測試驅動的開發,並且我越來越想在命令行中運行自動測試時此錯誤:爲什麼在測試Rails應用程序時未找到自動測試?

APL-IM23AGW:sample_app 220040168$ autotest 
/Users/220040168/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find autotest (>= 0) amongst [actionmailer-3.1.1, actionpack-3.1.1, activemodel-3.1.1, activerecord-3.1.1, activeresource-3.1.1, activesupport-3.1.1, addressable-2.2.6, ansi-1.3.0, arel-2.2.1, builder-3.0.0, bundler-1.0.21, coffee-rails-3.1.1, coffee-script-2.2.0, coffee-script-source-1.1.2, diff-lcs-1.1.3, erubis-2.7.0, execjs-1.2.9, heroku-2.11.0, hike-1.2.1, i18n-0.6.0, jquery-rails-1.0.16, json-1.6.1, launchy-2.0.5, mail-2.3.0, mime-types-1.16, multi_json-1.0.3, nokogiri-1.5.0, polyglot-0.3.2, rack-1.3.5, rack-cache-1.1, rack-mount-0.8.3, rack-ssl-1.3.2, rack-test-0.6.1, rails-3.1.1, railties-3.1.1, rake-0.9.2.2, rake-0.9.2, rdoc-3.11, rest-client-1.6.7, rspec-2.0.1, rspec-core-2.0.1, rspec-expectations-2.0.1, rspec-mocks-2.0.1, rspec-rails-2.0.1, rubyzip-0.9.4, sass-3.1.10, sass-rails-3.1.4, sprockets-2.0.3, sqlite3-1.3.4, sqlite3-ruby-1.3.1, sqlite3-ruby-1.2.5, term-ansicolor-1.0.7, thor-0.14.6, tilt-1.3.3, treetop-1.4.10, turn-0.8.3, tzinfo-0.3.30, uglifier-1.0.4, webrat-0.7.1] (Gem::LoadError) 
    from /Users/220040168/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec' 
    from /Users/220040168/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1210:in `gem' 
    from /Users/220040168/.rvm/rubies/ruby-1.9.2-p290/bin/autotest:18:in `<main>' 

我怎樣才能解決這個問題?

回答

1

確保自動測試是在你的Gemfile

group :test do 
    gem "autotest" 
end 
+0

謝謝,照顧它! –