[snip]
> I have a later readline
> installed under /usr/local, but readline's extconf.rb doesn't see it.
> 
> I did try adding the correct path to $CPPFLAGS and $LDFLAGS in
> extconf.rb, but that didn't seem to have any effect.

You'll probably need

../configure --with-readline-dir=/usr/local

or --with-readline-include=/usr/local/include/ and
--with-readline-include=/usr/local/lib/  (taking some guess at your actual
paths here, which may be utterly wrong).

hth,
Kero.