[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Runing ruby on rails code from console?

Jonathan Heinen

5/24/2006 4:10:00 PM

Hi,

if I want to start the code of a controller making use of activrecords
and other rails stuff, is there any possibilitie to start this script
from the consol or by a cron job?

Jonathan
3 Answers

psychotron

5/24/2006 4:34:00 PM

0

Jonathan Heinen <Jonathan.Heinen@rwth-aachen.de> wrote:

> Hi,
>
> if I want to start the code of a controller making use of activrecords
> and other rails stuff, is there any possibilitie to start this script
> from the consol or by a cron job?

I think the script runner is your friend

..script/runner -e production "Model.do_something"

--
Psychotron - http://w...
"The only thing that I know is that I don't know anything" -Socrates

Daniel Kaminski

5/24/2006 4:51:00 PM

0

Dnia 24-05-2006 o 18:10:21 Jonathan Heinen
<Jonathan.Heinen@rwth-aachen.de> napisa3:

> Hi,
>
> if I want to start the code of a controller making use of activrecords
> and other rails stuff, is there any possibilitie to start this script
> from the consol or by a cron job?
>
> Jonathan

Hi~
I think that `script/console` [or `ruby script\console` on windows
afair:)] from your rails dir will be the best choice. It gives you irb
with rails framework loaded. This commands takes `-e <environment>`
parameter to choose environment which you prefer.

Daniel

Jonathan Heinen

5/25/2006 12:31:00 PM

0

Psychotron schrieb:
> [...]
> .script/runner -e production "Model.do_something"
>

Thank you that is perfektly what i want! =)

Jonathan