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
- Install
readline
to/usr/local
- 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,
- Go to the
ext/readline
folder of your ruby source tree - Type
ruby extconf.rb
and then run themake && 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
Rubocop, How to Disable/Enable Cops on Blocks of Code
Open-Uri Is Not Redirecing Http to Https
P Method in Ruby Hard to Search For
Sort by Date in Descending Order in Ruby in Rails
How to Link to a Page with Page.Url Without the HTML Extension in Jekyll
Where Are Catch and Throw Useful in Ruby
Regex for Matching All Words Between a Set of Curly Braces
Kernel_Require.Rb:55:In 'Require': Cannot Load Such File Error
How to Spec Methods That Exit or Abort
Change Emacs Ruby-Mode Indent to 4 Spaces
Install Gem Gives "Failed to Build Gem Native Extension."
How to Force To_Yaml to Output Long Strings in Literal Block Style
Ruby Block Taking Array or Multiple Parameters
Dangerousattributeerror in Omniauth Railscast Tutorial: Create Is Defined by Activerecord