我升級到Rails 3.1.3
和Ruby 1.9.3
(通過RVM)後,我無法正常運行自動測試。我不知道發生了什麼事情,但是當我打印:Rails - 無法運行自動測試
$ autotest
它顯示奇怪的錯誤
loading autotest/rails_rspec2
/Users/serg/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require': cannot load such file -- autotest/fsevent (LoadError)
from /Users/serg/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/serg/rails_projects_terminal/sample_app/.autotest:2:in `<top (required)>'
from /Users/serg/.rvm/gems/[email protected]/gems/ZenTest-4.6.2/lib/autotest.rb:315:in `load'
from /Users/serg/.rvm/gems/[email protected]/gems/ZenTest-4.6.2/lib/autotest.rb:315:in `block in initialize'
from /Users/serg/.rvm/gems/[email protected]/gems/ZenTest-4.6.2/lib/autotest.rb:314:in `each'
from /Users/serg/.rvm/gems/[email protected]/gems/ZenTest-4.6.2/lib/autotest.rb:314:in `initialize'
from /Users/serg/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.8.0/lib/autotest/rspec2.rb:13:in `initialize'
from /Users/serg/.rvm/gems/ruby-1.9.3-head/gems/rspec-rails-2.8.0/lib/autotest/rails_rspec2.rb:31:in `initialize'
from /Users/serg/.rvm/gems/[email protected]/gems/ZenTest-4.6.2/lib/autotest.rb:244:in `new'
from /Users/serg/.rvm/gems/[email protected]/gems/ZenTest-4.6.2/lib/autotest.rb:244:in `run'
from /Users/serg/.rvm/gems/[email protected]/gems/ZenTest-4.6.2/bin/autotest:6:in `<top (required)>'
from /Users/serg/.rvm/gems/[email protected]/bin/autotest:19:in `load'
from /Users/serg/.rvm/gems/[email protected]/bin/autotest:19:in `<main>'
但是當我嘗試:
bundle exec autotest
它的工作原理。我該如何解決它?
我的Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.1.3'
gem 'gravatar_image_tag'
gem 'will_paginate'
gem 'rack'
gem 'texticle', "2.0", :require => 'texticle/rails'
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
end
gem 'jquery-rails'
group :development do
gem 'rspec-rails'
gem 'therubyracer-heroku'
gem 'pg'
gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'
gem 'faker'
end
group :test do
gem 'rspec-rails'
gem 'webrat'
gem 'spork'
gem 'autotest'
gem 'autotest-rails-pure'
gem 'autotest-fsevent'
gem 'autotest-growl'
gem 'factory_girl_rails'
end
group :production do
gem 'pg'
end
如果您在使用'bundler',你得把'自動測試,fsevent'在'Gemfile'爲好。 – 2014-06-18 18:16:05