Abraar Arique Diganto Abraar Arique Diganto - 2 months ago 48
Ruby Question

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?



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.