# Using readline in Ruby fails with the message 'Expected prompt ("$ ") but received "▽"'

**URL:** <https://forum.codecrafters.io/t/using-readline-in-ruby-fails-with-the-message-expected-prompt-but-received/10976>\
**Category:** Bug Reports\
**Tags:** challenge:shell\
**Created:** [May 23, 2025, 5:56am UTC](https://forum.codecrafters.io/t/using-readline-in-ruby-fails-with-the-message-expected-prompt-but-received/10976 "2025-05-23T05:56:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbraak](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/mbraak/32/11441_2.png) [@mbraak](https://forum.codecrafters.io/u/mbraak)\
**Post date:** [May 23, 2025, 5:56am UTC](https://forum.codecrafters.io/t/using-readline-in-ruby-fails-with-the-message-expected-prompt-but-received/10976/1 "2025-05-23T05:56:12Z")

</div>

I use Readline for the Ruby shell challenge: `Readline.readline('$ ', true)`

This works on my machine (OSX), but it fails when running `codecrafters test`. The error message is ‘Expected prompt ("$ ") but received “▽”’.

Output:

```auto
[tester::#QP2] Running tests for Stage #QP2 (Autocompletion - Builtin completion)
[tester::#QP2] Running ./your_program.sh
[your-program] ▽
[tester::#QP2] Expected prompt ("$ ") but received "▽"

```

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [May 23, 2025, 11:14am UTC](https://forum.codecrafters.io/t/using-readline-in-ruby-fails-with-the-message-expected-prompt-but-received/10976/3 "2025-05-23T11:14:00Z")

</div>

Hey @mbraak, could you [upload your code to GitHub](https://docs.codecrafters.io/features/publish-to-github) and share the link? It will be much easier to debug if I can run it directly.

---

<div class="post-metadata">

**Author:** ![mbraak](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/mbraak/32/11441_2.png) [@mbraak](https://forum.codecrafters.io/u/mbraak)\
**Post date:** [May 23, 2025, 2:50pm UTC](https://forum.codecrafters.io/t/using-readline-in-ruby-fails-with-the-message-expected-prompt-but-received/10976/4 "2025-05-23T14:50:20Z")

</div>

I added a Github repository: [GitHub - mbraak/codecrafters-shell-ruby](https://github.com/mbraak/codecrafters-shell-ruby)

---

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [May 28, 2025, 12:10am UTC](https://forum.codecrafters.io/t/using-readline-in-ruby-fails-with-the-message-expected-prompt-but-received/10976/6 "2025-05-28T00:10:12Z")

</div>

Likely something wonky with our tester here, we’re investigating! (cc: @Arpan-206)

---

<div class="post-metadata">

**Author:** ![Arpan-206](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/arpan-206/32/7413_2.png) [@Arpan-206](https://forum.codecrafters.io/u/Arpan-206)\
**Post date:** [June 11, 2025, 7:28am UTC](https://forum.codecrafters.io/t/using-readline-in-ruby-fails-with-the-message-expected-prompt-but-received/10976/7 "2025-06-11T07:28:37Z")

</div>

This has been fixed!  
Thanks for the patience!

---

<div class="post-metadata">

**Author:** ![mbraak](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/mbraak/32/11441_2.png) [@mbraak](https://forum.codecrafters.io/u/mbraak)\
**Post date:** [June 12, 2025, 6:16am UTC](https://forum.codecrafters.io/t/using-readline-in-ruby-fails-with-the-message-expected-prompt-but-received/10976/8 "2025-06-12T06:16:56Z")

</div>

Thanks for fixing.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [June 21, 2025, 12:32am UTC](https://forum.codecrafters.io/t/using-readline-in-ruby-fails-with-the-message-expected-prompt-but-received/10976/10 "2025-06-21T00:32:01Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
