How to Reinstall Ruby with Readline Support

How to reinstall ruby with readline support?

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.

Rails server giving Readline support error

byebug is a gem used for debugging.

The new app generator for rails includes it by default in the development & test environments with the following lines:

group :development, :test do
<% if RUBY_ENGINE == 'ruby' -%>
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'

I don't think it is important for a newcomer to be able to use it. I would recommend commenting out that line in the Gemfile, run bundle install and continue with your rails learning adventure.

How do I compile Readline support into Ruby

  1. Install readline to /usr/local
  2. Recompile ruby from scratch and use the --with-readline-dir=/usr/local switch

or if you have downloaded the ruby sources earlier and built it by hand,

  1. Go to the ext/readline folder of your ruby source tree
  2. Type ruby extconf.rb and then run the make && make install procedure for ruby.

How to get Readline support in IRB using RVM on Ubuntu 11.10

Ok, so this might seem pretty obvious, well it always is when you know the answer:

I gave up using RVM, and switched to rbenv - which I'm very pleased I did!

sudo apt-get install libreadline-gplv2-dev
CONFIGURE_OPTS="--with-readline-dir=/usr/include/readline --with-openssl-dir=/usr/local" rbenv-install 1.9.2-p290

This installed without error - and I'm still not convinced I need the gplv2 package as I've got libreadline6-dev installed. However that STILL didn't resolve my problem. It did remove RVM from the equation, and show me that despite my best efforts the IRB shell was refusing to use readline.

The answer came from reading through this great guide:

RubyTools.pdf

Inside my ~/.irbrc file I found:

IRB.conf[:USE_READLINE] = false

A quick update to:

IRB.conf[:USE_READLINE] = true

And I'm cooking on gas!!

Thanks for all the great answers and suggestion, I do appreciate your time.

Make error installing Ruby 1.9.2 with RVM and Readline under OSX Lion

I had a very similar issue. I eventually found that adding this to my .bash_profile stopped my initial make errors:

export ARCHFLAGS="-arch x86_64"

Also from the command line run the following:

brew install readline
brew link readline
brew install libxml2
brew link libxml2

Then when you install ruby use this command:

rvm install 1.9.2 -C --with-readline-dir=/usr/local/Cellar/readline/6.2.1/ --with-libxml2-dir=/usr/local/Cellar/xml2/2.7.8

Hope that helps

Problems with the rails console, RVM and readline

I had a similar problem it was with 1.9.2 on Ubuntu 10.04, but the symptoms were identical. In order to get it to work:

rvm pkg install readline

or prior to RVM version 1.6.32, you need the following command

rvm package install readline

Then:

apt-get install ncurses-dev

And then taking from their instructions at http://rvm.beginrescueend.com/packages/readline/

cd $HOME/.rvm/src/ruby-1.9.2-p0/ext/readline
ruby extconf.rb -- --with-readline-dir="$HOME/.rvm/usr"
make install

I had actually done a system rvm install on the server, so I needed to do this:

cd $HOME/.rvm/src/ruby-1.9.2-p0/ext/readline
ruby extconf.rb -- --with-readline-dir="/usr/local/rvm/usr"
make install

After that I was able to have full access to the console.

Trouble Installing Ruby 1.9.2 on OSX - Readline and Make errors

Are you compiling Readline from source? It might be less painful to compile and install Readline via Homebrew, assuming that you have at least one working version of Ruby on your system.

Once you've done that, you can try the RVM install of Ruby 1.9.2 again, and it should skip the Readline compilation step.

Updated in response to comment:

So you are using a Homebrew installed Readline. In that case, find out where the new (less broken) Readline libs are installed, and try passing the location of that version of Readline to the RVM install process. Something like:

rvm install ruby-1.9.2-p320 -C
--with-readline-dir=/usr/local/Cellar/readline/6.2.1

Clearly, your directory will be slightly different the one in my example.



Related Topics



Leave a reply



Submit