Bird
0
0

Identify the error in this command to install a gem:

medium📝 Debug Q6 of 15
Ruby - Gems and Bundler
Identify the error in this command to install a gem:
gem install --name rails
AIncorrect option '--name'; should be just gem name without option
BMissing gem source URL
CCommand should be 'install gem rails'
DNo error; command is correct
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the gem install command syntax

    The correct syntax is 'gem install ' without '--name' option.
  2. Step 2: Identify the invalid option usage

    '--name' is not a valid option for gem install, causing an error.
  3. Final Answer:

    Incorrect option '--name'; should be just gem name without option -> Option A
  4. Quick Check:

    gem install syntax = no '--name' option [OK]
Quick Trick: Use 'gem install gemname' without extra options [OK]
Common Mistakes:
  • Adding unsupported options like '--name'
  • Confusing command order
  • Assuming source URL is mandatory

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes