Rails Server Providing Readline Support Error

I am new to Ruby on Rails and I am trying to start a RoR server. But when I run the rails server command, it raises 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 use rbenv with Ruby 2.2.2 and Rails 4.2.1 I tried to follow the instructions on this blog http://vvv.tobiassjosten.net/ruby/readline-in-ruby-with-rbenv/ , but it does not work.

Any solutions?

Thanks!

+8
source share
8 answers

byebug is a gem used for debugging.

The new rail application generator includes it by default in development and testing 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โ€™s important for beginners to use it. I would recommend commenting on this line in the Gemfile, run bundle install and continue training on rails.

+2
source

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

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

+15
source

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

  • install readline brew install readline
  • reinstall / recompile ruby โ€‹โ€‹rbenv rbenv install 2.3.1
+5
source

I resolved it as follows

 brew unlink readline brew link readline --force 
+2
source

Add this to the gem development team.

 gem 'rb-readline' 

https://github.com/deivid-rodriguez/byebug/issues/289#issuecomment-251383465

+2
source

If you are in a hurry

Open your byebug history.rb

 /Users/user/.rvm/gems/ ruby-2.1.5@rails /gems/byebug-9.0.5/lib/byebug/history.rb 

and comment out the next line,

 require 'readline' 

But for debugging it is recommended to use byebug.

+1
source

I encountered the following error:

 Sorry, you can't use byebug without Readline 

Reinstalling ruby โ€‹โ€‹solved this for me (using rvm):

 rvm reinstall 2.1.5 

You can replace the ruby โ€‹โ€‹version, i.e. 2.1.5, the one you want to reinstall.

+1
source

July 2019 on Mac

I encountered the same problem on my computer, and with the following command I solved it, note that even if you have readline 8, you still need to reference version 7, as shown below:

 ln -s /usr/local/opt/readline/lib/libreadline.dylib /usr/local/opt/readline/lib/libreadline.7.dylib 
0
source

Source: https://habr.com/ru/post/987586/


All Articles