Bird
0
0

What is the main purpose of a Ruby gem?

easy📝 Conceptual Q11 of 15
Ruby - Gems and Bundler
What is the main purpose of a Ruby gem?
ATo compile Ruby code into machine language
BTo package and share reusable Ruby code
CTo create graphical user interfaces
DTo manage Ruby versions on your system
Step-by-Step Solution
Solution:
  1. Step 1: Understand what a gem is

    A gem is a package that contains Ruby code that can be reused in different projects.
  2. Step 2: Identify the main purpose

    The main purpose is to share and reuse code easily across Ruby projects.
  3. Final Answer:

    To package and share reusable Ruby code -> Option B
  4. Quick Check:

    Gem = reusable Ruby package [OK]
Quick Trick: Gems are for sharing code, not compiling or GUIs [OK]
Common Mistakes:
  • Thinking gems compile Ruby code
  • Confusing gems with Ruby version managers
  • Assuming gems create user interfaces

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes