Bird
0
0

Which of the following is the correct syntax to run a Ruby script named app.rb?

easy📝 Syntax Q3 of 15
Ruby - Basics and Runtime
Which of the following is the correct syntax to run a Ruby script named app.rb?
Aruby -run app.rb
Bruby app.rb
Cruby:app.rb
Druby/run app.rb
Step-by-Step Solution
Solution:
  1. Step 1: Identify valid Ruby command syntax

    The correct syntax to run a Ruby script is ruby filename.rb.
  2. Step 2: Eliminate invalid options

    Options with extra characters or wrong separators are invalid.
  3. Final Answer:

    ruby app.rb -> Option B
  4. Quick Check:

    Correct Ruby run syntax = ruby filename.rb [OK]
Quick Trick: Use 'ruby filename.rb' exactly to run scripts [OK]
Common Mistakes:
MISTAKES
  • Adding extra flags incorrectly
  • Using colons or slashes wrongly
  • Typing 'run' as part of command

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes