[LRUG] Shebang

Matthew Rudy Jacobs matthewrudyjacobs at gmail.com
Fri Jun 27 04:47:34 PDT 2008


if that doesnt work it may also be down to the way your script is being run.

eg. I belive that capistrano commands are issued seperately, rather than
through a sustained Bash session, so ~/.profile doesn't get loaded.

get a script runner to do "puts system("echo $PATH")"
or something (when you've temporarily set the shebang to the full path)
then you'll know the PATH in the exact instance!

2008/6/27 Roland Swingler <roland.swingler at gmail.com>:

> 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
> >
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20080627/b7e0d39b/attachment-0003.html>


More information about the Chat mailing list