ruby script/console production 実行したらエラーになった。

エラー内容:


[root@localhost redmine-1.1.0]# ruby script/console production
Loading production environment (Rails 2.3.5)
/usr/local/ruby/1.8.7/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file to load -- readline (LoadError)
from /usr/local/ruby/1.8.7/lib/ruby/1.8/irb/completion.rb:10
from /usr/local/ruby/1.8.7/lib/ruby/1.8/irb/init.rb:254:in `require'
from /usr/local/ruby/1.8.7/lib/ruby/1.8/irb/init.rb:254:in `load_modules'
from /usr/local/ruby/1.8.7/lib/ruby/1.8/irb/init.rb:252:in `each'
from /usr/local/ruby/1.8.7/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
from /usr/local/ruby/1.8.7/lib/ruby/1.8/irb/init.rb:21:in `setup'
from /usr/local/ruby/1.8.7/lib/ruby/1.8/irb.rb:54:in `start'
from /usr/local/ruby/1.8.7/bin/irb:13

readlineファイルがないみたい。なので全体ファイルで探してみた。


find / -name readline             Enterを押す



rubyをインストールした時のソースファイルの中にあった。
「私は、rubyソースコードからインストールした」


/usr/local/src/ruby-1.8.7-p334/ext/readline

なので


>cd /usr/local/src/ruby-1.8.7-p334/ext/readline
>ls
Makefile README README.ja depend extconf.rb mkmf.log readline.c
>ruby extconf.rb             Enterを押す
checking for tgetnum() in -lncurses... no
checking for tgetnum() in -ltermcap... no
checking for tgetnum() in -lcurses... no
checking for readline/readline.h... no
checking for editline/readline.h... no




対応:
まず 

>sudo yum install readline-devel
>ruby extconf.rb             Enterを押す
checking for tgetnum() in -lncurses... no
checking for tgetnum() in -ltermcap... yes
checking for readline/readline.h... yes
checking for readline/history.h... yes
checking for readline() in -lreadline... yes
checking for rl_filename_completion_function()... yes
checking for rl_username_completion_function()... yes
checking for rl_completion_matches()... yes
checking for rl_deprep_term_function in stdio.h,readline/readline.h,readline/history.h... yes
checking for rl_completion_append_character in stdio.h,readline/readline.h,readline/history.h... yes
checking for rl_basic_word_break_characters in stdio.h,readline/readline.h,readline/history.h... yes
checking for rl_completer_word_break_characters in stdio.h,readline/readline.h,readline/history.h... yes
checking for rl_basic_quote_characters in stdio.h,readline/readline.h,readline/history.h... yes
checking for rl_completer_quote_characters in stdio.h,readline/readline.h,readline/history.h... yes
checking for rl_filename_quote_characters in stdio.h,readline/readline.h,readline/history.h... yes
checking for rl_attempted_completion_over in stdio.h,readline/readline.h,readline/history.h... yes
checking for rl_library_version in stdio.h,readline/readline.h,readline/history.h... yes
checking for rl_event_hook in stdio.h,readline/readline.h,readline/history.h... yes
checking for rl_cleanup_after_signal()... yes
checking for rl_clear_signals()... yes
checking for rl_vi_editing_mode()... yes
checking for rl_emacs_editing_mode()... yes
checking for replace_history_entry()... yes
checking for remove_history()... yes
creating Makefile

赤い部分ないみたいので、以下の入れる。


>sudo yum install ncurses-devel
>ruby extconf.rb             Enterを押す
これで全部yesになった。よ〜し

後は


make
make install

問題解決です。