いなばです。

お話の、ext/readline/mkmf.logです。
==============================================================
have_library: checking for tgetnum() in -lncurses... -------------------- no

"gcc -o conftest -I../.. -I../../. -I../.././ext/readline  -g -O2
conftest.c  -L'../..'  -rdynamic -Wl,-export-dynamic     -lruby-static
-lncurses  -ldl -lcrypt -lm   -lc"
conftest.c: In function 't':
conftest.c:3: error: 'tgetnum' undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))tgetnum; return 0; }
/* end */

"gcc -o conftest -I../.. -I../../. -I../.././ext/readline  -g -O2
conftest.c  -L'../..'  -rdynamic -Wl,-export-dynamic     -lruby-static
-lncurses  -ldl -lcrypt -lm   -lc"
/usr/bin/ld: cannot find -lncurses
collect2: ld はステータス 1 で終了しました
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { tgetnum(); return 0; }
/* end */

--------------------

have_library: checking for tgetnum() in -ltermcap... -------------------- no

"gcc -o conftest -I../.. -I../../. -I../.././ext/readline  -g -O2
conftest.c  -L'../..'  -rdynamic -Wl,-export-dynamic     -lruby-static
-ltermcap  -ldl -lcrypt -lm   -lc"
conftest.c: In function 't':
conftest.c:3: error: 'tgetnum' undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))tgetnum; return 0; }
/* end */

"gcc -o conftest -I../.. -I../../. -I../.././ext/readline  -g -O2
conftest.c  -L'../..'  -rdynamic -Wl,-export-dynamic     -lruby-static
-ltermcap  -ldl -lcrypt -lm   -lc"
/usr/bin/ld: cannot find -ltermcap
collect2: ld はステータス 1 で終了しました
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { tgetnum(); return 0; }
/* end */

--------------------

have_library: checking for tgetnum() in -lcurses... -------------------- no

"gcc -o conftest -I../.. -I../../. -I../.././ext/readline  -g -O2
conftest.c  -L'../..'  -rdynamic -Wl,-export-dynamic     -lruby-static
-lcurses  -ldl -lcrypt -lm   -lc"
conftest.c: In function 't':
conftest.c:3: error: 'tgetnum' undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))tgetnum; return 0; }
/* end */

"gcc -o conftest -I../.. -I../../. -I../.././ext/readline  -g -O2
conftest.c  -L'../..'  -rdynamic -Wl,-export-dynamic     -lruby-static
-lcurses  -ldl -lcrypt -lm   -lc"
/usr/bin/ld: cannot find -lcurses
collect2: ld はステータス 1 で終了しました
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { tgetnum(); return 0; }
/* end */

--------------------

have_header: checking for readline/readline.h... -------------------- no

"gcc -E -I../.. -I../../. -I../.././ext/readline  -g -O2  conftest.c
-o conftest.i"
conftest.c:1:31: error: readline/readline.h: No such file or directory
checked program was:
/* begin */
1: #include <readline/readline.h>
/* end */

--------------------

have_header: checking for editline/readline.h... -------------------- no

"gcc -E -I../.. -I../../. -I../.././ext/readline  -g -O2  conftest.c
-o conftest.i"
conftest.c:1:31: error: editline/readline.h: No such file or directory
checked program was:
/* begin */
1: #include <editline/readline.h>
/* end */

--------------------
=============================================================================================================


readline  の 情報は
 dpkg -l | grep readline
として、
ii  libreadline-ruby1.8   1.8.5-4ubuntu2   Readline interface for Ruby 1.8
ii  libreadline5           5.2-2ubuntu1     GNU readline and history
libraries, run-time libraries
ii  libreadline5-dev       5.2-2ubuntu1     GNU readline and history
libraries, development files
ii  readline-common        5.2-2ubuntu1     GNU readline and history
libraries, common files

と表示されたので入っているかと思いますが、わからないことも多いので、まちがっていたらごめんなさい。

$ gzip -dc ruby-1.8.6.tar.gz | tar xf -
$ cd ruby-1.8.6
$ ./configure
$ make
$ make test
$ sudo make install

としました。