rvm環境でRuby実行時にReadlineエラーが起きた時の対処法

Tags: [ Ruby ] [ 備忘録 ] [ Heroku ] Published: 2011/11/30

タイトル通り。さくらVPS(CentOS)にrvmでRubyをインストールし、Heroku環境を構築しようとしたらReadlineエラーが起きた。

$ rvm install 1.9.2
(略)
$ rvm use 1.9.2
$ gem install heroku
(略)
$ heroku
/home/kk_Ataka/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- readline (LoadError)
     from /home/kk_Ataka/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
     from /home/kk_Ataka/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.14.0/lib/heroku/command/run.rb:1:in `<top (required)>'
     from /home/kk_Ataka/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
     from /home/kk_Ataka/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
     from /home/kk_Ataka/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.14.0/lib/heroku/command.rb:17:in `block in load'
     from /home/kk_Ataka/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.14.0/lib/heroku/command.rb:16:in `each'
     from /home/kk_Ataka/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.14.0/lib/heroku/command.rb:16:in `load'
     from /home/kk_Ataka/.rvm/gems/ruby-1.9.2-p290/gems/heroku-2.14.0/bin/heroku:13:in `<top (required)>'
     from /home/kk_Ataka/.rvm/gems/ruby-1.9.2-p290/bin/heroku:19:in `load'
     from /home/kk_Ataka/.rvm/gems/ruby-1.9.2-p290/bin/heroku:19:in `<main>'

readlineが入っていなかったのだろうか?

$ sudo yum install readline-devel
$ cd $rvm_path/src/RUBYVERSION/ext/readline
$ ruby extconf.rb
$ make
$ make install

オプション--with-readline-dir指定は特になくていけた。

opensslなども同じように解決できるみたい。

blog comments powered by Disqus

Author: kk_Ataka / Powered by Jekyll on GitHub Pages