Running in non-dev envs. with script/runner shebang setup

6 views
Skip to first unread message

Wes Gamble

unread,
Apr 24, 2009, 4:39:22 AM4/24/09
to rubyonra...@googlegroups.com
All,

I have a script that runs script/runner via the shebang mechanism at the
top o the file, like so:

#!/usr/bin/env ./script/runner

This works fine in development, how would I get it to run in
non-development environments?

Thanks,
Wes
--
Posted via http://www.ruby-forum.com/.

Johannes Huning

unread,
Apr 24, 2009, 5:12:05 AM4/24/09
to rubyonra...@googlegroups.com
$ script/runner -h

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.
[..]

The -e option is probably what you are looking for.

> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonra...@googlegroups.com
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
> -~----------~----~----~----~------~----~------~--~---
>

PGP.sig

Wes Gamble

unread,
Apr 24, 2009, 10:59:13 AM4/24/09
to rubyonra...@googlegroups.com
That's correct, but I can't get it to work when the script/runner
command is _in a file_, like so:

import_physicians.rb:

#!/usr/bin/env ./script/runner -e production

If I run import_physicians.rb, this doesn't work.

W

Wes Gamble

unread,
Apr 24, 2009, 11:10:50 AM4/24/09
to rubyonra...@googlegroups.com
Duh.

RAILS_ENV=production lib/import_physicians.rb

works fine.

Reply all
Reply to author
Forward
0 new messages