5

I'm running ruby 2.0.0p247, rails 4.0.1 under rbenv management. When I first tried to start rails console, I had an error that readline is not found. I installed rb-readline gem and added to the gemfile as follows gem 'rb-readline', '0.4.2'. Adter bundle update the console became able to run. However, when I press upwards arrow to recall previous command, the console crashes with the following error:

/home/clergyman/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rb-readline-0.4.2/lib/rbreadline.rb:4269:in `block in _rl_dispatch_subseq': invalid byte sequence in UTF->8 (ArgumentError)

A common solution to this is trying to bing 'rb-readline' gem of later version like 0.5.0, however if change the gem version this way, I cannot even start the console, it crashes as if readline is not installed.

I know that there are a lot of similar quastions here, but no luck with my configuration of rails/ruby so far. I'll appreciate any help, thanks in advance! Please pay attention to ruby/rails version before referring to other similar questions.

Clergyman
  • 281
  • 1
  • 3
  • 13
  • It may help you: http://stackoverflow.com/a/9528543/1047207 – RAJ Apr 09 '15 at 11:41
  • Try to get rid of `rb-readline`. Gems with native extensions are often unstable and this one is also unmaintained. Look into the Gemfile.lock to find the gem, which depends on `rb-readline`. – Dieter Pisarewski Apr 27 '15 at 14:10

1 Answers1

1

I had the similar issue which was resolved by upgrading readline gem to 0.5.0 and setting it to false.

gem 'rb-readline', '~> 0.5.0', :require => false

(ruby 2.0.0-p481, rails 4.1.0, rbenv)
Sport
  • 8,570
  • 6
  • 46
  • 65
spacerbot
  • 11
  • 1