Forum: Ruby on Rails script/runner: what the...!?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Fe19694d020631c05c0359d92868d282?d=identicon&s=25 Mark Larimer (Guest)
on 2007-01-16 22:38
(Received via mailing list)
What's wrong here? script/runner looks okay, but doesn't run as
advertised. Check it out:

./script/runner --help
Usage: ./script/runner [options] ('Some.ruby(code)' or a filename)

    -e, --environment=name           Specifies the environment for the
runner to operate under (test/development/production).
                                     Default: development

    -h, --help                       Show this help message.

You can also use runner as a shebang line for your scripts like this:
#!/usr/bin/env /home/mark/ariel/script/runner

Product.find(:all).each { |p| p.price *= 2 ;! }

./script/runner -e production 'TourDateMailing.generate_new'
invalid option: -e
Test::Unit automatic runner.
Usage: ./script/runner [options] [-- untouched arguments]

    -r, --runner=RUNNER              Use the given RUNNER.
                                     (c[onsole], f[ox], g[tk], g[tk]2,
    -n, --name=NAME                  Runs tests matching NAME.
                                     (patterns may be used).
    -t, --testcase=TESTCASE          Runs tests in TestCases matching
                                     (patterns may be used).
    -v, --verbose=[LEVEL]            Set the output level (default is
                                     (s[ilent], p[rogress], n[ormal],
        --                           Stop processing options so that
                                     remaining options will be passed
to the
    -h, --help                       Display this help.

Deprecated options:
        --console                    Console runner (use --runner).
        --gtk                        GTK runner (use --runner).
        --fox                        Fox runner (use --runner).

Any ideas?

Eeb89a2e7017e06e39435b8bae2f44cd?d=identicon&s=25 Brandon Casci (brandon)
on 2007-04-12 22:05
I'm having the same exact problem. Please post the solution if you found
E37ca8b3eee534fa6781f7ba13743afb?d=identicon&s=25 Ryan (Guest)
on 2007-04-15 19:57
I'm having the same issue after upgrading a Rails app to v1.2.3. I can
work around it by adding an explicit exit call to the end of the runner
text. Any ideas what's going on here?

E37ca8b3eee534fa6781f7ba13743afb?d=identicon&s=25 Ryan Wood (ryanwood)
on 2007-04-17 15:10
Just wanted to update what my solution was. I was using the file_column
plugin and it had the following line in the init.rb file:

require 'test_case'

That apparently confused runner and passed the request to the
Test::Unit::AutoRunner. Once removed, the problem was solved. I've
submitted a patch to Sebastian that should resolve the issue. YMMV.

F148ec0cad8ea241b1cfd80e7ec8a7df?d=identicon&s=25 Fredrik (Guest)
on 2007-04-17 15:45
(Received via mailing list)
I'm a little confused about the require 'test_case' and how that
affects runner. Same thing happened to me all of a sudden a while back
and my only resolution was to run it with RAILS_ENV=production script/
runner "".


On Apr 17, 8:10 am, Ryan Wood <>
This topic is locked and can not be replied to.