# Capistrano - run command

**URL:** <https://www.ruby-forum.com/t/capistrano-run-command/85040>\
**Category:** Rails\
**Created:** [March 22, 2006, 1:31am UTC](https://www.ruby-forum.com/t/capistrano-run-command/85040 "2006-03-22T01:31:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [March 22, 2006, 1:31am UTC](https://www.ruby-forum.com/t/capistrano-run-command/85040/1 "2006-03-22T01:31:52Z")

</div>

Man, I can’t wait to get my hands on the capistrano book when it  
comes out :-).

I have the following task in capistrano.rake (any task in deploy.rb  
just does not want to be called)

# ========= desc “Restarts the lighttpd server” task :restart\_server do run “/users/home/jkopanas/bin/lighttpdctrl restart” end

When I run rake restart\_server I get the following errror:

# ========= undefined method `run’ for #Object:0x1de968

According to documentation and examples I should be able to use run  
with no problem to execute commands on the server. How come I am  
getting an error.

Insight is greatly appreciated.

Your Friend,

John K.

---

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [March 22, 2006, 6:25am UTC](https://www.ruby-forum.com/t/capistrano-run-command/85040/2 "2006-03-22T06:25:31Z")

</div>

See the email I just sent in reply to your other message. 🙂 The  
problem is that you are confusing rake and capistrano tasks. The two  
are not compatible, though they have similar syntaxes.

- Jamis
