Bird
0
0

Which command runs a Ruby script named script.rb from the terminal?

easy📝 Conceptual Q1 of 15
Ruby - Basics and Runtime
Which command runs a Ruby script named script.rb from the terminal?
Arun script.rb
Bexecute script.rb
Cruby script.rb
Dstart script.rb
Step-by-Step Solution
Solution:
  1. Step 1: Understand the Ruby command usage

    The ruby command is used to run Ruby scripts from the terminal.
  2. Step 2: Identify the correct syntax

    The correct syntax is ruby filename.rb, so ruby script.rb runs the script.
  3. Final Answer:

    ruby script.rb -> Option C
  4. Quick Check:

    Running Ruby script = ruby script.rb [OK]
Quick Trick: Use 'ruby filename.rb' to run scripts from terminal [OK]
Common Mistakes:
MISTAKES
  • Using 'run' instead of 'ruby'
  • Using 'execute' command
  • Using 'start' command

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes