Question

After my upgrade to Rails 3.1.3 and Ruby 1.9.3 (via RVM) i can't normally run autotest. I don't know what has happened, but when i print:

$ autotest

It shows strange error

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/ruby-1.9.3-head@global/gems/ZenTest-4.6.2/lib/autotest.rb:315:in `load'
    from /Users/serg/.rvm/gems/ruby-1.9.3-head@global/gems/ZenTest-4.6.2/lib/autotest.rb:315:in `block in initialize'
    from /Users/serg/.rvm/gems/ruby-1.9.3-head@global/gems/ZenTest-4.6.2/lib/autotest.rb:314:in `each'
    from /Users/serg/.rvm/gems/ruby-1.9.3-head@global/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/ruby-1.9.3-head@global/gems/ZenTest-4.6.2/lib/autotest.rb:244:in `new'
    from /Users/serg/.rvm/gems/ruby-1.9.3-head@global/gems/ZenTest-4.6.2/lib/autotest.rb:244:in `run'
    from /Users/serg/.rvm/gems/ruby-1.9.3-head@global/gems/ZenTest-4.6.2/bin/autotest:6:in `<top (required)>'
    from /Users/serg/.rvm/gems/ruby-1.9.3-head@global/bin/autotest:19:in `load'
    from /Users/serg/.rvm/gems/ruby-1.9.3-head@global/bin/autotest:19:in `<main>' 

But when i try:

bundle exec autotest

It works. How can i fix it?

My 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                                                                     
Était-ce utile?

La solution 2

I solved it. I found this page: http://www.viget.com/extend/how-why-to-run-autotest-on-your-mac/ and then i printed in the Terminal:

$ gem update ZenTest
$ gem cleanup ZenTest
$ gem install autotest-fsevent

After that autotest started to work fine.

Autres conseils

I had that issue as well, and to fix it I had to do what you did :

$ gem update ZenTest
$ gem cleanup ZenTest
$ gem install autotest-fsevent

But I also had to add 'autotest-growl' and 'autotest-fsevent' to my gemfile, which now looks like this:

group :development do
    gem 'sqlite3'
    gem 'rspec-rails'
    gem 'autotest'
    gem 'ZenTest'
    gem 'autotest-growl'
    gem 'autotest-fsevent'
end

Then

$ Bundle install

And now

$ autotest

works just fine :)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top