Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails server giving Readline support error

I'm new to Ruby on Rails and I'm trying to start the RoR server. But when I run the command rails server it gives me the following error:

Sorry, you can't use byebug without Readline. To solve this, you need to
    rebuild Ruby with Readline support. If using Ubuntu, try `sudo apt-get
    install libreadline-dev` and then reinstall your Ruby.
bin/rails:6: warning: already initialized constant APP_PATH
/home/abraar/ror/bin/rails:6: warning: previous definition of     APP_PATH     was here
Usage: rails COMMAND [ARGS]

I'm using rbenv with Ruby 2.2.2 and Rails 4.2.1 I tried following the instructions on this blog post http://vvv.tobiassjosten.net/ruby/readline-in-ruby-with-rbenv/ but it's not working.

Any solutions?

Thanks!

like image 771
Abraar Arique Diganto Avatar asked May 20 '15 15:05

Abraar Arique Diganto


4 Answers

I was facing the following error:

Sorry, you can't use byebug without Readline

Reinstalling ruby resolved this for me (using rvm):

rvm reinstall 2.1.5

You can replace ruby version ie, 2.1.5 with the one you want to reinstall.

like image 112
Faisal Raza Avatar answered Oct 02 '22 20:10

Faisal Raza


To fix this (for OSX, tested on Sierra), run following command in your shell -

ln -s /usr/local/opt/readline/lib/libreadline.dylib /usr/local/opt/readline/lib/libreadline.6.dylib

like image 17
Abhinav Mehta Avatar answered Oct 29 '22 11:10

Abhinav Mehta


July 2019 on Mac

I faced this same issue on my machine & running the following command solved it, note that even if you have version 8 of readline you still need to link to version 7 as shown:

ln -s /usr/local/opt/readline/lib/libreadline.dylib /usr/local/opt/readline/lib/libreadline.7.dylib
like image 8
Ahmed Elkoussy Avatar answered Oct 29 '22 12:10

Ahmed Elkoussy


I solved the issue by (commands for mac with homebrew and rbenv):

  • installing readline brew install readline
  • reinstalling / recompiling ruby rbenv install 2.3.1
like image 5
dom Avatar answered Oct 29 '22 11:10

dom