ruby, testing

Autotest not working

Autotest broke on me, probably from months of neglect (I’ve been running tests directly from Textmate), and I had a tough time figuring it out. Whenever I tried to run autotest, I’d get:

/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/ZenTest-4.1.3/lib/unit_diff.rb:70:in `gets': No such file or directory - -u (Errno::ENOENT)
from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/ZenTest-4.1.3/lib/unit_diff.rb:70:in `parse_input'
from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/ZenTest-4.1.3/lib/unit_diff.rb:182:in `unit_diff'
from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/ZenTest-4.1.3/lib/unit_diff.rb:56:in `unit_diff'
from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/ZenTest-4.1.3/bin/unit_diff:37
from /opt/ruby-enterprise/bin/unit_diff:19:in `load'
from /opt/ruby-enterprise/bin/unit_diff:19

It turns out that the autotest file in rubygems/bin/autotest wasn’t using the -s flag in the shebang line and that was causing the -u in the unit_diff program to be interpreted as a filename. To fix, i simply added -s to the end of the shebang line so it looks something like this:

#!/opt/ruby-enterprise/bin/ruby -ws

2 Comments

speak up

Add your comment below, or trackback from your own site.

Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*Required Fields