How to restart ferret_server using Capistrano?

This is a ferret question. I have the ferret_server DRb server up and
running, but I’m trying to get it so that I can restart the ferret
server through Capistrano whenever I restart the Mongrel processes. Not
having a lot of luck with this at the bottom of my deploy.rb:

task :post_deployment do
run “cd /home/site.com/web/rails/current/ && script/ferret_server -e
production stop”
run “cd /home/site.com/web/rails/current/ && script/ferret_server -e
production start”
end
after ‘deploy:restart’, :post_deployment

After the restart it tries to execute the stop and then start, but
fails:

** [out :: [email protected]] no such file to load –
/usr/bin/…/config/environment
command finished

So it looks like it’s not respecting the current directory. Any ideas on
how to get around this? I have to restart the DRb ferret_server each
time so that it restarts using the most recent version of the rails app
that I just deployed.

I’m trying to do this, too. I can SSH into the server and restart Drb
manually, but there’s gotta be some easy way to do this with Capistrano,
probably in deploy. Does anyone know how to do this?

Joe P. wrote:

I’m trying to do this, too. I can SSH into the server and restart Drb
manually, but there’s gotta be some easy way to do this with Capistrano,
probably in deploy. Does anyone know how to do this?

there might be this, :

before “deploy:start” do
run “#{current_path}/script/ferret_server -e production start”
end

after “deploy:stop” do
run “#{current_path}/script/ferret_server -e production stop”
end

after ‘deploy:restart’ do
run “cd #{current_path} && ./script/ferret_server -e production stop”
run “cd #{current_path} && ./script/ferret_server -e production start”
end

but it throws me errors saying that I don’t have permissions…