Rails 3, Rspec 2, Autotest

Trying to set up a Rails 3 project with RSpec and Autotest. I followed
these steps exactly:

But when I start up autotest, I get:

$ autotest
loading autotest/rails
style: Rails

instead of:

$ autotest
loading autotest/rails_rspec2
style: RailsRspec2

And autotest doesn’t seem to do anything. Any idea what’s happening?
I’m using Ruby 1.9.2-head in rvm. Relevant gems:

autotest (4.2.9)
autotest-rails (4.1.0)
rspec (2.0.0.beta.6)
rspec-core (2.0.0.beta.6)
rspec-expectations (2.0.0.beta.6)
rspec-mocks (2.0.0.beta.6)
rspec-rails (2.0.0.beta.6)
ZenTest (4.3.1)

Thanks a lot for any help.
Mark

I am having similar issue getting this working. I am running
rails3.beta3 with ruby 1.8.7. I followed output · GitHub
and I get the following:

loading autotest/rails_rspec2
Autotest style autotest/rails_rspec2 doesn’t seem to exist. Aborting.

I uninstalled and reinstalled the ZenTest & autotest gems with no luck.
The same thing occurs in other rails3 apps.

Any help would be much appreciated

–Tim

On Apr 17, 2010, at 9:42 AM, Tim R. wrote:

I am having similar issue getting this working. I am running rails3.beta3 with ruby 1.8.7. I followed output · GitHub and I get the following:

loading autotest/rails_rspec2
Autotest style autotest/rails_rspec2 doesn’t seem to exist. Aborting.

I uninstalled and reinstalled the ZenTest & autotest gems with no luck. The same thing occurs in other rails3 apps.

Any help would be much appreciated

I just modified the gist slightly. It looks like rubygems won’t find
rspec-rails-2.0.0.beta.7 if we ask for “>= 2.0.0.beta”. Anyhow, if I
follow the setup in output · GitHub, it works for me with
ruby 1.8.7.

On Sat, Apr 17, 2010 at 11:10 AM, David C. [email protected]
wrote:

same thing occurs in other rails3 apps.

Any help would be much appreciated

I just modified the gist slightly. It looks like rubygems won’t find
rspec-rails-2.0.0.beta.7 if we ask for “>= 2.0.0.beta”. Anyhow, if I follow
the setup in output · GitHub, it works for me with ruby 1.8.7.

Using 1.9.2-head and following the steps in the updated gist I am
seeing the same behavior that Mark is reporting.

michaelguterl@carini ~/code/example$ autotest
loading autotest/rails
style: Rails


Best,
Michael G.

I am still not able to get this going either using 1.8.7 or ruby 1.9.2

Macintosh-7:example tim$ autotest
loading autotest/rails_rspec2
Autotest style autotest/rails_rspec2 doesn’t seem to exist. Aborting.
Macintosh-7:example tim$ rvm use ruby-head
Using ruby head
Macintosh-7:example tim$ autotest
loading autotest/rails
style: Rails

I am assuming its something particular to my systems but have not been
able to isolate it. Any thoughts as to how i might debug or isolate the
dependency?

–Tim

On Sun, Apr 18, 2010 at 12:52 PM, Michael G. [email protected]
wrote:

Using 1.9.2-head and following the steps in the updated gist I am
everything working fine with 1.8.7.

From within the project directory in 1.8.7

Autotest.autodiscover # => [“rails”, “rspec2”]

from within the project directory in 1.9.2

Autotest.autodiscover # => [“rails”]

Digging even further, this happens because in Ruby 1.9.2 the current
directory is not added to $LOAD_PATH which results in
Gem.find_files(“autotest/discover”) not finding the
autotest/discover.rb in RAILS_ROOT.

I believe this is a bug in autotest and I have filed a report here:
http://rubyforge.org/tracker/index.php?func=detail&aid=28113&group_id=419&atid=1678

Best,
Michael G.

I get a slightly different error when following the gist. Here is my
error, in case the extra data point helps:

$ autotest
loading autotest/rails_rspec_rspec2
Error loading Autotest style autotest/rails_rspec_rspec2 (no such file
to load – autotest/rails_rspec_rspec2). Aborting.

Note the extra “rspec” in the path that it’s trying to load.

Here is some more info about my environment:

woods@beidleheimer ~/src/git/example $ gem list rspec

*** LOCAL GEMS ***

rspec (2.0.0.beta.8, 1.3.0, 1.2.9, 1.2.8, 1.2.6, 1.2.2, 1.2.0, 1.1.9,
1.1.3, 1.1.0)
rspec-core (2.0.0.beta.8)
rspec-expectations (2.0.0.beta.8)
rspec-mocks (2.0.0.beta.8)
rspec-rails (1.3.2, 1.2.9, 1.2.7.1, 1.2.6, 1.2.2, 1.2.0, 1.1.9)
woods@beidleheimer ~/src/git/example $ gem list rails

*** LOCAL GEMS ***

rails (3.0.0.beta3, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.2.2, 2.1.2, 2.1.1,
2.1.0, 2.0.4, 2.0.2, 2.0.1, 1.2.3)
woods@beidleheimer ~/src/git/example $ ruby --version
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10]

On Sun, Apr 18, 2010 at 12:30 PM, Michael G. [email protected]
wrote:

I uninstalled and reinstalled the ZenTest & autotest gems with no luck. The
seeing the same behavior that Mark is reporting.

michaelguterl@carini ~/code/example$ autotest
loading autotest/rails
style: Rails


This looks to be a bug with autotest and 1.9.2 as I was able to get
everything working fine with 1.8.7.

From within the project directory in 1.8.7

Autotest.autodiscover # => [“rails”, “rspec2”]

from within the project directory in 1.9.2

Autotest.autodiscover # => [“rails”]

Best,
Michael G.

On May 9, 8:43 am, Scott W. [email protected] wrote:

I get a slightly different error when following the gist. Here is my
error, in case the extra data point helps:

$ autotest
loading autotest/rails_rspec_rspec2
Error loading Autotest style autotest/rails_rspec_rspec2 (no such file
to load – autotest/rails_rspec_rspec2). Aborting.

Note the extra “rspec” in the path that it’s trying to load.

That’s because autotest looks in the gem paths and the load path for
any files named autotest/discover.rb. It’s finding the one in the
rspec-1.3.0 gem, which adds ‘rspec’, and the one in your app, which is
probably adding ‘rspec2’.

Try adding a file to your app named autotest/rails_rspec_rspec2.rb and
require ‘autotest/rails_rspec2’ in that file. Let us know if that
works.

I found that I could get rid of my original error:

loading autotest/rails_rspec2
Autotest style autotest/rails_rspec2 doesn’t seem to exist. Aborting.

By installing rspec-rails on my system:

sudo gem install rspec-rails -v=2.0.0.beta.8

Now when I run autotest in my app- or in the example app from the gist-
I get:

rodeo:example rob$ autotest
loading autotest/rails_rspec2
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
-rrubygems /Library/Ruby/Gems/1.8/gems/rspec-core-2.0.0.beta.8/bin/rspec
/Users/rob/example/spec/views/widgets/new.html.erb_spec.rb
/Users/rob/example/spec/controllers/widgets_controller_spec.rb
/Users/rob/example/spec/views/widgets/show.html.erb_spec.rb
/Users/rob/example/spec/views/widgets/index.html.erb_spec.rb
/Users/rob/example/spec/views/widgets/edit.html.erb_spec.rb
/Users/rob/example/spec/helpers/widgets_helper_spec.rb
/Users/rob/example/spec/models/widget_spec.rb
/Users/rob/.bundle/ruby/1.8/gems/rspec-rails-2.0.0.beta.10/lib/rspec/rails/matchers.rb:22:
uninitialized constant RSpec::Matchers (NameError)
from
/Users/rob/.bundle/ruby/1.8/gems/rspec-rails-2.0.0.beta.10/lib/rspec/rails.rb:7
from /Users/rob/example/spec/spec_helper.rb:5
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:inrequire’
from /Users/rob/example/spec/views/widgets/new.html.erb_spec.rb:1
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:inrequire’
from
/Library/Ruby/Gems/1.8/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/configuration.rb:233:in
require_files_to_run' from /Library/Ruby/Gems/1.8/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/configuration.rb:233:inmap’
from
/Library/Ruby/Gems/1.8/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/configuration.rb:233:in
require_files_to_run' from /Library/Ruby/Gems/1.8/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:37:inconfigure’
from
/Library/Ruby/Gems/1.8/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:24:in
run' from /Library/Ruby/Gems/1.8/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:12:inautorun’
from /Library/Ruby/Gems/1.8/gems/rspec-core-2.0.0.beta.8/bin/rspec:2

On Jun 6, 2010, at 1:28 PM, Rob L. [email protected] wrote:

I found that I could get rid of my original error:

loading autotest/rails_rspec2
Autotest style autotest/rails_rspec2 doesn’t seem to exist. Aborting.

By installing rspec-rails on my system:

sudo gem install rspec-rails -v=2.0.0.beta.8

Try beta.10. The backtrace below shows a mix of 8 and 10.

HTH

That got it, thanks!