[LRUG] Shebang

Roland Swingler roland.swingler at gmail.com
Fri Jun 27 03:47:08 PDT 2008


Hi,

Presumably Bj is a background job runner?

It might be possible that the PATH variable isn't set for the user
that is running, or at least doesn't include the directory with ruby
in it.

So it will work for you on the command line, because your user has
ruby in its path. You could try "su your-bj-user" and then "echo
$PATH" to check this.

Cheers,
Roland

On Fri, Jun 27, 2008 at 10:09 AM, Andrew Stewart
<boss at airbladesoftware.com> wrote:
> Hola El Rugsters,
>
> In an action in a Rails app, I submit jobs to bj[1] like this:
>
>  Bj.submit "./script/runner 'Archive.find(#{@archive.id}).rebuild'"
>
> The jobs start, but fail with this on stderr:
>
>  /usr/bin/env: ruby: No such file or directory
>
> My app's script/runner has this shebang line:
>
>  #!/usr/bin/env ruby
>
> However, env works on the command line:
>
>  $ /usr/bin/env ruby -v                # ruby 1.8.6 etc
>  $ /usr/bin/env ruby -e "puts 'foo'"   # foo
>
> Any ideas how to get my jobs running correctly?  I suppose I could work
> around the problem by changing the shebang line in script/runner to point
> directly to my ruby installation, but I'd rather not touch that
> Rails-generated file.
>
> Thanks and regards,
> Andy
>
> [1] http://codeforpeople.rubyforge.org/svn/bj/trunk/README
>
> -------
> AirBlade Software Ltd
> http://airbladesoftware.com
>
>
>
>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>



More information about the Chat mailing list