2

I've got a problem with autotest. It seems to drop in and out which is strange. It was working fine then started to shoot a growl message APP: Could Not Run Tests.

I had to mess around for a while to get autotest to work but it just seems really unstable. Im new to rails so I'm sure I'm doing something wrong.

I've dug around for an answer already and running autotest -s rspec2 doesnt seem to work either (I'm typing whilst cd'd into the app directory).

Every time I run a test (save a file) here's what I get:

bundle exec /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -S /Library/Ruby/Gems/1.8/gems/rspec-core-2.4.0/bin/rspec --tty '/Users/userx/rails_projects/sample_app/spec/controllers/pages_controller_spec.rb' /Users/userx/rails_projects/sample_app/spec/spec_helper.rb:2:inrequire': no such file to load -- spork (LoadError) from /Users/userx/rails_projects/sample_app/spec/spec_helper.rb:2 from /Users/userx/rails_projects/sample_app/spec/controllers/pages_controller_spec.rb:1:in require' from /Users/userx/rails_projects/sample_app/spec/controllers/pages_controller_spec.rb:1 from /Library/Ruby/Gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:inload' from /Library/Ruby/Gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:in load_spec_files' from /Library/Ruby/Gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:inmap' from /Library/Ruby/Gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:in load_spec_files' from /Library/Ruby/Gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/command_line.rb:18:inrun' from /Library/Ruby/Gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/runner.rb:55:in run_in_process' from /Library/Ruby/Gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/runner.rb:46:inrun' from /Library/Ruby/Gems/1.8/gems/rspec-core-2.4.0/lib/rspec/core/runner.rb:10:in autorun' from /Library/Ruby/Gems/1.8/gems/rspec-core-2.4.0/bin/rspec:4

Ads
  • 287
  • 1
  • 3
  • 5

3 Answers3

0

Did you install spork? from your log file:

require': no such file to load -- spork 
pjammer
  • 9,489
  • 5
  • 46
  • 56
  • I did try and install spork but then canned it. I'm going to try and remove the require command now - didnt think of that – Ads Feb 05 '11 at 13:59
  • tbh, I'm a test unit guy... but i also have no idea what spork is. your log output is showing that your posts controller spec on line 1 can't run, and your app needs a gem called spork. – pjammer Feb 05 '11 at 14:01
  • Ok so I removed `require "autotest/growl"` from the autotest file which didnt work. Is Spork optional? I;ve still got the gem installed - should I get rid of it? – Ads Feb 05 '11 at 14:03
  • You do have ZenTest and autotest-rails installed right? Also, can you access rails console test without this error? – pjammer Feb 05 '11 at 14:43
  • I've got ZenTest and autotest-rails-pure installed. Sorry I'm new to rails, how would I access the rails console test? Also I just realised my comment above was wrong, growl obviously needs to stay in autotest file. I thought I had `require "autotest/spork"` which I dont. – Ads Feb 05 '11 at 14:54
  • do `gem install spork` and do `rails console` from your rails root directory (/home/railsappname) – pjammer Feb 05 '11 at 14:57
0

This can occur on 1.9.x if you are running spork and have --drb in your .rspec file. I don't know why.

Spork is typically optional - it just makes test run faster.

Dirk
  • 3,073
  • 4
  • 31
  • 36
0

This happened to me and tripped me up for a few hours. If you're simple trying to use Test Unit and have it run the test and growl every time you save, try using autotest-rails-pure and autotest-standalone:

Follow the install directions here: https://github.com/grosser/autotest

Tim Scollick
  • 1,242
  • 1
  • 16
  • 17