Bird
0
0

This ~/.irbrc snippet causes an error:

medium📝 Debug Q7 of 15
Ruby - Ecosystem and Best Practices
This ~/.irbrc snippet causes an error:
IRB.conf[:PROMPT_MODE] = SIMPLE

Why?
APROMPT_MODE is a string key, not a symbol
BIRB.conf is read-only and cannot be assigned
CSIMPLE should be a symbol (:SIMPLE), not a bare word
DThe assignment operator is missing
Step-by-Step Solution
Solution:
  1. Step 1: Identify the syntax error

    In Ruby, bare words like SIMPLE are undefined constants unless declared.
  2. Step 2: Correct usage for prompt modes

    Prompt modes are symbols, so it should be :SIMPLE.
  3. Final Answer:

    SIMPLE should be a symbol (:SIMPLE), not a bare word -> Option C
  4. Quick Check:

    Use symbols (colon prefix) for IRB prompt modes [OK]
Quick Trick: Always prefix prompt modes with a colon for symbols [OK]
Common Mistakes:
  • Using bare words instead of symbols
  • Confusing string and symbol keys
  • Assuming IRB.conf is immutable

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes