1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

pry起動時にエラーが出た場合の対処法

Last updated at Posted at 2015-03-30

pryを起動しようとしたところ、下記のエラーが出力された。
環境:Ubuntu

$ 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
/home/vagrant/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- readline (LoadError)
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/config/default.rb:151:in `lazy_readline'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/config/default.rb:6:in `block in <class:Default>'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/config/default.rb:125:in `instance_eval'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/config/default.rb:125:in `block (2 levels) in <class:Default>'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/config/behavior.rb:54:in `public_send'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/config/behavior.rb:54:in `method_missing'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/history.rb:19:in `restore_default_behavior'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/history.rb:14:in `initialize'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/pry_class.rb:33:in `new'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/pry_class.rb:33:in `history'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/pry_class.rb:222:in `load_history'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/pry_class.rb:129:in `initial_session_setup'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/cli.rb:206:in `block in <top (required)>'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/cli.rb:83:in `call'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/cli.rb:83:in `block in parse_options'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/cli.rb:83:in `each'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/lib/pry/cli.rb:83:in `parse_options'
	from /home/vagrant/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.10.1/bin/pry:16:in `<top (required)>'
	from /home/vagrant/.rbenv/versions/2.1.1/bin/pry:23:in `load'
	from /home/vagrant/.rbenv/versions/2.1.1/bin/pry:23:in `<main>'  

どうやら、Readlineというのがないみたい。
なので、インストール。

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

起動するでしょうか。。。

$ pry
[1] pry(main)>

やった :laughing:

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?