[rspec-users] Autotest Errors

David Chelimsky dchelimsky at gmail.com
Mon Feb 7 19:12:00 EST 2011


On Wed, Feb 2, 2011 at 6:24 PM, Trenton Scott <TTS at rainleader.com> wrote:
> >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/

^^ 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


More information about the rspec-users mailing list