Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does ruby -run do? How does it work?

Tags:

ruby

I've seen this used to start a process:

ruby -run

What does it do?

Where is the documentation located?

like image 679
B Seven Avatar asked Feb 07 '23 12:02

B Seven


1 Answers

It's a little misleading in appearance... The flag isn't -run as in the verb run, but rather -r to require the un.rb file from the standard library, which according to documentation, contains:

Utilities to replace common UNIX commands in Makefiles etc

The -r<libraryname> flag allows you to require a library from the command line before your program's execution begins.

See ruby --help for the command line flags (I suspect you already did).

like image 90
Michael Berkowski Avatar answered Feb 23 '23 11:02

Michael Berkowski