# Autotest Errors

**URL:** <https://www.ruby-forum.com/t/autotest-errors/202867>\
**Category:** RSpec\
**Created:** [February 8, 2011, 1:03am UTC](https://www.ruby-forum.com/t/autotest-errors/202867 "2011-02-08T01:03:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [February 8, 2011, 1:03am UTC](https://www.ruby-forum.com/t/autotest-errors/202867/1 "2011-02-08T01:03:17Z")

</div>

> From my Rails project directory in Terminal, I’m able to run ‘bundle  
> exec rspec spec/’ and it works successfully. When I try and run  
> ‘autotest’, however, I get the error(s) below. Note: my .autotest file  
> has require ‘autotest/growl’ and require ‘autotest/fsevent’ in it and  
> I have both installed.

Here’s the error (below), any thoughts?

====

Trenton-Scotts-MacBook-Air:sample\_app TTS$ autotest  
loading autotest/rails\_rspec2  
style: RailsRspec2

* * *

bundle exec /Users/TTS/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -S /Users/  
TTS/.rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2.3.1/bin/rspec --tty ‘/  
Users/TTS/Documents/Rails/sample\_app/spec/controllers/  
pages\_controller\_spec.rb’  
/Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2.0.1/lib/rspec/  
core/option\_parser.rb:18:in `parse!': invalid option: --tty (OptionParser::InvalidOption) from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2.0.1/lib/ rspec/core/option_parser.rb:4:in`parse!’  
from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2.0.1/lib/  
rspec/core/configuration\_options.rb:64:in `parse_command_line_options' from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2.0.1/lib/ rspec/core/configuration_options.rb:46:in`parse\_options’  
from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2.0.1/lib/  
rspec/core/runner.rb:41:in `run' from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2.0.1/lib/ rspec/core/runner.rb:10:in`block in autorun’

==

---

<div class="post-metadata">

**Author:** ![Trenton\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f6c823/32.png) [@Trenton\_S](https://www.ruby-forum.com/u/Trenton_S)\
**Post date:** [February 8, 2011, 1:38am UTC](https://www.ruby-forum.com/t/autotest-errors/202867/2 "2011-02-08T01:38:46Z")

</div>

On Wed, Feb 2, 2011 at 6:24 PM, Trenton S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Trenton-Scotts-MacBook-Air:sample\_app TTS$ autotest  
> loading autotest/rails\_rspec2  
> style: RailsRspec2
> 
> * * *
> 
> bundle exec /Users/TTS/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -S /Users/

^^ bundle exec ^^

> TTS/.rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2.3.1/bin/rspec --tty '/

^^ rspec-core-2.3.1 ^^

> Users/TTS/Documents/Rails/sample\_app/spec/controllers/  
> pages\_controller\_spec.rb’  
> /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2.0.1/lib/rspec/  
> core/option\_parser.rb:18:in `parse!': invalid option: --tty  
> (OptionParser::InvalidOption)  
> from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2.0.1/lib/

^^ rspec-core-2.0.1 ^^

> rspec/core/option\_parser.rb:4:in `parse!' from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2.0.1/lib/ rspec/core/configuration_options.rb:64:in `parse\_command\_line\_options’  
> from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2.0.1/lib/  
> rspec/core/configuration\_options.rb:46:in `parse_options' from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2.0.1/lib/ rspec/core/runner.rb:41:in `run’  
> from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/rspec-core-2.0.1/lib/  
> rspec/core/runner.rb:10:in `block in autorun’

The problem is that there are two different versions of rspec-core  
being loaded: 2.0.1 and 2.3.1.

Autotest generates a command to run specs. In this case, the generated  
command starts with ‘bundle exec’, and it looks like the bundle is  
configured to load rspec-core-2.0.1. The autotest command that you are  
starting with is not prefixed with ‘bundle exec’, which means it’s  
using whatever gems are available in the current shell environment,  
which includes rspec-core-2.3.1.

Try running ‘bundle exec autotest’ instead of just ‘autotest’.

HTH,  
David
