# What does script/runner do?

**URL:** <https://www.ruby-forum.com/t/what-does-script-runner-do/146349>\
**Category:** Rails\
**Created:** [August 20, 2008, 8:17am UTC](https://www.ruby-forum.com/t/what-does-script-runner-do/146349 "2008-08-20T08:17:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [August 20, 2008, 8:17am UTC](https://www.ruby-forum.com/t/what-does-script-runner-do/146349/1 "2008-08-20T08:17:40Z")

</div>

I’m trying to learn how to schedule jobs. I understand that cron and  
script/runner is a good choice. But I don’t fully understand  
script/runner. Why do I need it? Can’t Rails run Ruby anyway?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [August 20, 2008, 8:27am UTC](https://www.ruby-forum.com/t/what-does-script-runner-do/146349/2 "2008-08-20T08:27:19Z")

</div>

> I’m trying to learn how to schedule jobs. I understand that cron and  
> script/runner is a good choice. But I don’t fully understand  
> script/runner. Why do I need it? Can’t Rails run Ruby anyway?

Rails is a framework that is written in Ruby. So technically Ruby  
runs Rails.

script/runner is a Ruby script that does what needs doing to load up  
the Rails framework and let whatever you pass to it run within that  
framework.

So, anything you can type in ./script/console you could pass to ./  
script/runner on the command line.

cron + script/runner = scheduled jobs

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [August 20, 2008, 9:00am UTC](https://www.ruby-forum.com/t/what-does-script-runner-do/146349/3 "2008-08-20T09:00:48Z")

</div>

Philip H. wrote:

> > I’m trying to learn how to schedule jobs. I understand that cron and  
> > script/runner is a good choice. But I don’t fully understand  
> > script/runner. Why do I need it? Can’t Rails run Ruby anyway?
> 
> Rails is a framework that is written in Ruby. So technically Ruby  
> runs Rails.
> 
> script/runner is a Ruby script that does what needs doing to load up  
> the Rails framework and let whatever you pass to it run within that  
> framework.
> 
> So, anything you can type in ./script/console you could pass to ./  
> script/runner on the command line.
> 
> cron + script/runner = scheduled jobs

Thanks. Now I understand. 🙂
