LoginSignup
6
3

More than 5 years have passed since last update.

Pry実行時のエラー「Sorry, you can't use Pry without Readline or a compatible library.・・・」を解決する

Posted at

pryを使おうとして使えなかったので、解決するまでの知見を残しておきます。
よくある感じの対処法でQiita等にも解決法は上がっていますが、微妙にやったことが違ったので。

環境

  • ruby 2.3.1
  • OS X El Capitan

対処法

まず、pryを入れた後に実行するとこのようなエラーが出力されました。

$ pry
Sorry, you can't use Pry without Readline or a compatible library.
Possible solutions:
 * Rebuild Ruby with Readline support using `--with-readline`
 * Use the rb-readline gem, which is a pure-Ruby port of Readline
 * Use the pry-coolline gem, a pure-ruby alternative to Readline
...

とりあえずrb-readlineを入れます。

$ gem install rb-readline
Fetching: rb-readline-0.5.3.gem (100%)
Successfully installed rb-readline-0.5.3
Parsing documentation for rb-readline-0.5.3
Installing ri documentation for rb-readline-0.5.3
Done installing documentation for rb-readline after 3 seconds
1 gem installed

自分はこれだけで動かなかったため、rubyを入れ直しました。

$ rbenv install -f 2.3.1

これでpryが使えるようになりました。

$ pry
[1] pry(main)>

参考

6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3