6

I have installed Ruby through RVM as instructions on https://github.com/wayneeseguin/rvm#installation.

For information I have all the archives (readline-5.2.tar.gz, readline-6.2.tar.gz, ruby-1.9.3-p327.tar.bz2, rubygems-1.8.24.tgz, wayneeseguin-rvm-stable.tgz and yaml-0.1.4.tar.gz) in ~/.rvm/archives directory and I don't want to re-download them in any way.

When I do:

sudo /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config

I get:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
Note, selecting 'libncurses5-dev' instead of 'ncurses-dev'
libtool is already the newest version.
sqlite3 is already the newest version.
libxslt1-dev is already the newest version.
libc6-dev is already the newest version.
openssl is already the newest version.
git-core is already the newest version.
subversion is already the newest version.
zlib1g is already the newest version.
libncurses5-dev is already the newest version.
curl is already the newest version.
libreadline6 is already the newest version.
libyaml-dev is already the newest version.
autoconf is already the newest version.
pkg-config is already the newest version.
libxml2-dev is already the newest version.
build-essential is already the newest version.
libssl-dev is already the newest version.
libreadline6-dev is already the newest version.
automake is already the newest version.
zlib1g-dev is already the newest version.
bison is already the newest version.
libsqlite3-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I have even done:

$ rvm pkg install readline
$ rvm reinstall 1.9.2 --with-readline-dir=$rvm_path/usr

But I still get this on irb:

Readline was unable to be required, if you need completion or history install readline then reinstall the ruby. You may follow 'rvm notes' for dependencies and/or read the docs page https://rvm.io/packages/readline/ . Be sure you 'rvm remove X ; rvm install X' to re-compile your ruby with readline support after obtaining the readline libraries.

I have done re-installation process 4-5 times.

Santosh Kumar
  • 26,475
  • 20
  • 67
  • 118

4 Answers4

5

What about

rvm reinstall 1.9.3

You could do that once you have installed basic dependencies like build essentials etc. I had similar issue and I had to install some dependencies and reinstalling ruby did the trick.

List of dependencies below

sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core \
zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev \
autoconf libc6-dev libncurses5-dev automake libtool bison subversion pkg-config
ch4nd4n
  • 4,110
  • 2
  • 21
  • 43
4

Considering you have RVM, you should take advantage of the helpful command rvm requirements, as that will give you the command that you need to run for your specific environment/OS.

Pablo Fernandez heelhook
  • 11,985
  • 3
  • 21
  • 20
2

Your ruby should be most likely installed with readline support if you had the packages from rvm requirements installed.

You can verify that readline is installed by running:

rvm use 1.9.3
find $MY_RUBY_HOME -name readline.so | xargs ldd

From what I see in the responses a proper flow has to be repeated:

rm -rf $rvm_path/usr/
rvm get head
rvm remove 1.9.3
rvm install 1.9.3 --debug

If you still can not get it working - please make double sure you repeat the above steps, do not add additional flags or switches, make sure to clean up /etc/rvmrc and ~/.rvmrc from extra compilation flags. if it all fails provide output of the rvm install 1.9.3 --debug command.

mpapis
  • 52,729
  • 14
  • 121
  • 158
  • `ldd: missing file arguments` – Santosh Kumar Dec 20 '12 at 10:24
  • what is in your `$rvm_path/src/ruby-1.9.3-p327/ext/readline/mkmf.log` ? – mpapis Dec 20 '12 at 11:15
  • I was about the test if it works or not but my Terminal is hung after the installation (I don't get prompts on new terminals). Here's the output of [rvm install 1.9.3 --debug](https://gist.github.com/4345252) – Santosh Kumar Dec 20 '12 at 13:15
  • Wait wait.. Everything got fine after unsourcing `~/.profile`. Now can you tell me what was going wrong with my readline and how did your answer helped me? – Santosh Kumar Dec 20 '12 at 13:24
  • lol something is wrong with your setup, better open a ticket for rvm, SO is not the primary support site for rvm: https://github.com/wayneeseguin/rvm/issues – mpapis Dec 20 '12 at 15:08
1

You might just rebuild the ruby executable the old fashioned configure / make way. It shouldn't take that long. The advantage is it'll utilize dependencies it finds such as readline.

seand
  • 5,168
  • 1
  • 24
  • 37