Bird
0
0

In your ~/.irbrc file, you set:

medium📝 Debug Q6 of 15
Ruby - Ecosystem and Best Practices
In your ~/.irbrc file, you set:
IRB.conf[:SAVE_HISTORY] = "500"

Why might IRB fail to save the command history as expected?
ABecause the history file path is missing
BBecause the key :SAVE_HISTORY is deprecated
CBecause the value should be an integer, not a string
DBecause IRB requires a boolean value for :SAVE_HISTORY
Step-by-Step Solution
Solution:
  1. Step 1: Identify the data type issue

    The value assigned to IRB.conf[:SAVE_HISTORY] is a string "500" instead of an integer.
  2. Step 2: Understand IRB's expectation

    IRB expects an integer to specify how many commands to save in history.
  3. Final Answer:

    Because the value should be an integer, not a string -> Option C
  4. Quick Check:

    Check the data type of the value assigned [OK]
Quick Trick: Use integers for numeric IRB config values [OK]
Common Mistakes:
  • Using strings instead of integers for numeric settings
  • Assuming :SAVE_HISTORY accepts strings
  • Not setting a history file path

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes