railsのscript consoleでno such file to load -- readlineと怒られた - tetu1984の日記
CentOSにソースからインストールしたruby環境のrailsのscript/consoleで以下のエラーが発生。
$ ./script/console production Loading production environment (Rails 2.3.10) /usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file to load -- readline (LoadError) from /usr/local/lib/ruby/1.8/irb/completion.rb:10 from /usr/local/lib/ruby/1.8/irb/init.rb:254:in `require' from /usr/local/lib/ruby/1.8/irb/init.rb:254:in `load_modules' from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `each' from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules' from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup' from /usr/local/lib/ruby/1.8/irb.rb:54:in `start' from /usr/local/bin/irb:13
対処方法
readline-develをインストールしてからmakeしなおす。
$ sudo yum install readline-devel $ cd ~/src/ruby-1.8.7-p302/ext/readline/ $ ruby extconf.rb $ make $ sudo make install