rails console doesn't load due to libreadline
Ran across this today, to solve it I did:
brew rm -f readline
brew install readline
brew link readline --force
Hope it helps.
EDIT: I recently ran into this problem again (after downgrading Ruby) since I wrote this, and I now prefer @califrench's solution from the comments below:
ln -s /usr/local/opt/readline/lib/libreadline.dylib /usr/local/opt/readline/lib/libreadline.7.dylib
Why do I get a Readline error when trying to start rails console?
Please read the output of:
rvm requirements
It will show you list of libraries you need to install to make good use of Ruby
After installing all the libs, clean rvm installed libs and reinstall Ruby:
rm -rf $rvm_path/usr
rvm reinstall 1.9.3
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.
rails console require cannot load such file readline
Readline gem is required by your application but not specified in your Gemfile
Please add this to your gem file
gem 'rb-readline'
Also reinstall
libreadline-dev
Related Topics
Can't Find Gem Railties (>= 0.A) with Executable Rails (Gem::Gemnotfoundexception)
What Is the Advantage of Creating an Enumerable Object Using To_Enum in Ruby
Behaviour of Array Bang Methods
How to Generate a Unique Request Id in Rails
Given a Url, How to Get Just the Domain
Using Form_For Tag with Get Method
Monitor Ruby Processes with Monit
Catching Command-Line Errors Using %X
Should Gemfile.Lock Be Committed to Source Control on Windows
How to Prevent Rails Controller Generator to Modify Config/Routes.Rb
Using Fork in Windows with Ruby
Prawn PDF: I Need to Generate Nested Tables
Exec Onlyif Registry Value Is Not Present
Installing Ncurses for Ruby on Windows
Generic Way to Replace an Object in It's Own Method