0
0
Rubyprogramming~10 mins

Running scripts with ruby command - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to run a Ruby script named 'hello.rb' from the command line.

Ruby
ruby [1]
Drag options to blanks, or click blank then click option'
Ascript.py
Brun.rb
Cmain.js
Dhello.rb
Attempts:
3 left
💡 Hint
Common Mistakes
Using a filename with the wrong extension like '.py' or '.js'.
Forgetting to include the script filename after 'ruby'.
2fill in blank
medium

Complete the command to run a Ruby script called 'calculator.rb' located in the current directory.

Ruby
ruby [1]
Drag options to blanks, or click blank then click option'
Aapp.js
Bscript.py
Ccalculator.rb
Dprogram.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to run a non-Ruby file.
Typing the wrong filename.
3fill in blank
hard

Fix the error in the command to run 'test_script.rb' by completing the missing part.

Ruby
ruby [1]
Drag options to blanks, or click blank then click option'
Atest_script.txt
Btest_script.rb
Ctest_script.js
Dtest_script.py
Attempts:
3 left
💡 Hint
Common Mistakes
Using a filename with a wrong extension.
Typing a filename that does not exist.
4fill in blank
hard

Fill both blanks to run a Ruby script named 'server.rb' located in a folder called 'app'.

Ruby
ruby [1]/[2]
Drag options to blanks, or click blank then click option'
Aapp
Bserver.rb
Cbin
Dmain.rb
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping folder and filename positions.
Using the wrong folder or filename.
5fill in blank
hard

Fill both blanks to run a Ruby script named 'app.rb' inside the 'src' folder with verbose mode enabled.

Ruby
ruby [1] [2]
Drag options to blanks, or click blank then click option'
A-v
Bsrc/app.rb
C--verbose
D-h
Attempts:
3 left
💡 Hint
Common Mistakes
Placing the script path before the flag.
Using incorrect flags like '-v' or '-h'.