What does script/runner do?

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?

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

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. :slight_smile: