Forum: Ruby on Rails Cmd. line scripts that use Rails?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Derek (Guest)
on 2006-03-15 01:24
Hi all,

I would like to use the Rails framework through scripts.  Some of us
like using browsers as an interface, but many of us prefer the command
line.

Does anyone know about writing Ruby scripts that can make use of the
Rails framework to access the database, all from the command line?

Thanks,
- Derek
Jonathan V. (Guest)
on 2006-03-15 02:06
(Received via mailing list)
It's pretty much built-in. Just use script/console.

-Jonathan
Derek (Guest)
on 2006-03-15 02:25
Thanks, but I think I need to explain myself better.  For example, I
want to write a script, executable from the command line, that takes
options from the user and performs the necessary database functions
through Rails.

If I want to edit a LineItem, let's say, then this command line script
would not be responsible for handling locking, validation, counts,
relationships, etc.  Instead, I want to have the Rails code do it.

Is this the sort of thing to which you were referring?

- Derek
Jonathan V. (Guest)
on 2006-03-15 03:15
(Received via mailing list)
You can use script/runner to execute a rails comand.

-Jonathan.
Derek (Guest)
on 2006-03-15 03:19
Great, thanks!
This topic is locked and can not be replied to.