Forum: Ferret acts_as_ferret server_manager fails under Capistrano

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.
John Leach (Guest)
on 2008-07-28 13:06
(Received via mailing list)

in lib/server_manager.rb we have lines 38 and 39:

require(File.join(File.dirname(ENV['_']), '../config/environment'))

This works fine if I run it in a normal shell but borks when the server
is run using Capistrano:

 ** [out ::] no such file to load --

Confirmed here by someone else too:

Any idea why ENV['_'] is being used here rather than __FILE__ ?  Looks
a bit like it's supposed to work better when aaf is installed as a gem,
rather than as a plugin in the vendor dir (as I'm using it here).

Actually, it looks like this is good behaviour by aaf and bad behaviour
by Capistrano, but was wondering if anyone can shed any light on it.


John Leach (Guest)
on 2008-07-28 14:25
(Received via mailing list)

>From the bash man page:

"When bash invokes an external command, the variable _ is set to the
full file name of the command and passed to that command in its

cap> on ruby -e "puts ENV['_']"
 ** [out ::] /bin/sh

Found a solution though.  Setting the following option in my Capistrano

default_run_options[:shell] = false

gets me:

cap> on ruby -e "puts ENV['_']"
** [out ::] /usr/bin/ruby

Now the ferret_server runs properly. This change hasn't affected
anything else for me - according to the Capistrano 2.1 announcement, if
your default shell is POSIX compliant it should be fine (most cases I'd
guess this is true, unless you have some weird setup).

For reference, the code to use ENV['_'] was added here:

Hope that helps someone.


On Mon, 2008-07-28 at 11:55 +0100, John Leach wrote:
>  ** [out ::] no such file to load -- 
> by Capistrano, but was wondering if anyone can shed any light on it.
> Thanks,
> John.
> --

Julio Cesar Ody (Guest)
on 2008-07-29 05:16
(Received via mailing list)
I've came across that same issue a few times. I solved it by
uncommenting line #38 and commenting #39.
This topic is locked and can not be replied to.