# Run external ruby script from contoller

**URL:** <https://www.ruby-forum.com/t/run-external-ruby-script-from-contoller/80670>\
**Category:** Rails\
**Created:** [December 29, 2006, 8:09pm UTC](https://www.ruby-forum.com/t/run-external-ruby-script-from-contoller/80670 "2006-12-29T20:09:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpjolicoeur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a183cd/32.png) [@cpjolicoeur](https://www.ruby-forum.com/u/cpjolicoeur)\
**Post date:** [December 29, 2006, 8:09pm UTC](https://www.ruby-forum.com/t/run-external-ruby-script-from-contoller/80670/1 "2006-12-29T20:09:01Z")

</div>

I have an already existing ruby script that will interface with the  
[del.icio.us](http://del.icio.us) api. I’m putting together a rails app and would like to use  
this already existing ruby script for several reasons.

My question is how to call this ruby script from within my controller?

I simply want to call the script, pass it a few parameters and then  
proceed onto my next statement, so the script executes as its own  
process and the controller action continues executing whether or not the  
script execution was successful.

anyone done this before?

---

<div class="post-metadata">

**Author:** ![cpjolicoeur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a183cd/32.png) [@cpjolicoeur](https://www.ruby-forum.com/u/cpjolicoeur)\
**Post date:** [December 29, 2006, 8:27pm UTC](https://www.ruby-forum.com/t/run-external-ruby-script-from-contoller/80670/2 "2006-12-29T20:27:54Z")

</div>

Let me somewhat rephrase the question (although I still would like to  
know the answer to my original question).

The more I think about it the more I want to keep the processing in a  
rails controller simply for the fact that I have all the database and  
model info existing.

So, how would I pass processing within a controller action to another  
controller action without waiting for the second action to finish.

i.e.

def process\_request  
go\_perform\_other\_process #(process but don’t wait for completion  
before continuing)  
do rest of action routine  
end

---

<div class="post-metadata">

**Author:** ![cpjolicoeur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a183cd/32.png) [@cpjolicoeur](https://www.ruby-forum.com/u/cpjolicoeur)\
**Post date:** [February 19, 2007, 6:14am UTC](https://www.ruby-forum.com/t/run-external-ruby-script-from-contoller/80670/3 "2007-02-19T06:14:37Z")

</div>

Hi,

How did you do it finally ?

Craig J. wrote:

> Let me somewhat rephrase the question (although I still would like to  
> know the answer to my original question).
> 
> The more I think about it the more I want to keep the processing in a  
> rails controller simply for the fact that I have all the database and  
> model info existing.
> 
> So, how would I pass processing within a controller action to another  
> controller action without waiting for the second action to finish.
> 
> i.e.
> 
> def process\_request  
> go\_perform\_other\_process #(process but don’t wait for completion  
> before continuing)  
> do rest of action routine  
> end

---

<div class="post-metadata">

**Author:** ![cpjolicoeur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a183cd/32.png) [@cpjolicoeur](https://www.ruby-forum.com/u/cpjolicoeur)\
**Post date:** [February 19, 2007, 6:18am UTC](https://www.ruby-forum.com/t/run-external-ruby-script-from-contoller/80670/4 "2007-02-19T06:18:46Z")

</div>

Check out BackgrounDRb – [http://backgroundrb.rubyforge.org/](http://backgroundrb.rubyforge.org/).
