# How to restart ferret\_server using Capistrano?

**URL:** <https://www.ruby-forum.com/t/how-to-restart-ferret-server-using-capistrano/125294>\
**Category:** Ferret\
**Created:** [January 8, 2008, 12:28am UTC](https://www.ruby-forum.com/t/how-to-restart-ferret-server-using-capistrano/125294 "2008-01-08T00:28:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cvandyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f6c823/32.png) [@cvandyck](https://www.ruby-forum.com/u/cvandyck)\
**Post date:** [January 8, 2008, 12:28am UTC](https://www.ruby-forum.com/t/how-to-restart-ferret-server-using-capistrano/125294/1 "2008-01-08T00:28:56Z")

</div>

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 :: removed\_email\_address@domain.invalid] 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.

---

<div class="post-metadata">

**Author:** ![cvandyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f6c823/32.png) [@cvandyck](https://www.ruby-forum.com/u/cvandyck)\
**Post date:** [February 7, 2008, 9:01pm UTC](https://www.ruby-forum.com/t/how-to-restart-ferret-server-using-capistrano/125294/2 "2008-02-07T21:01:57Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![cvandyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f6c823/32.png) [@cvandyck](https://www.ruby-forum.com/u/cvandyck)\
**Post date:** [September 9, 2008, 12:15am UTC](https://www.ruby-forum.com/t/how-to-restart-ferret-server-using-capistrano/125294/3 "2008-09-09T00:15:36Z")

</div>

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â€¦
