I was trying to install ruby on the newly released Ubuntu 14.04 and I was running into some issues with readline.
The error looked something like
readline.c:1977:26: error: ‘Function’ undeclared (first use in this function) rl_pre_input_hook = (Function *)readline_pre_input_hook; ^
The solution is to configure ruby with our lib_readline.so
sudo apt-get install openssl libreadline-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison libcurl4-openssl-dev
Grab the source from http://www.ruby-lang.org/en/downloads/
cd / && mkdir srcs && cd srcs
NOTE: make sure the ./configure – -with-readline-dir has two dashes. For some reason WP is stripping that.