Syntax
Ruby Run a Script Syntax
In Ruby, run a script: runs a Ruby file — ruby script.rb
Quick Answer
- Syntax
ruby script.rb
RubySyntax
Run a Script
Code example
ruby script.rb
Runs a Ruby file.
How to run a script in Ruby
- Open your Ruby file or editor.
- Copy the example, then replace its sample names and values for your code.
Ruby Run a Script Syntax
Use ruby script.rb.
Related Syntax References
Frequently asked questions
What is the Ruby syntax for run a script?
Use this pattern: ruby script.rb
Can I copy this Ruby code example?
Yes. Use Copy code and adapt the example to your program.
Is this Ruby syntax different on Mac or Windows?
No. The language syntax is the same across operating systems.
Official source · How we verify