Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.

share|improve this question
    
It may help you: stackoverflow.com/a/9528543/1047207 –  RAJ Apr 9 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. –  canc Apr 27 at 14:10

1 Answer 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)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.