Incorrect Rails Byte Sequence in UTF-8 (ArgumentError)

I am running ruby ​​2.0.0p247, rails 4.0.1 running rbenv. When I first tried to start the rails console, I had an error when readline was not found. I installed the rb-readline gem and added it to the gemfile as follows gem 'rb-readline', '0.4.2'. Updating the Adter package allowed the console to start. However, when I press the up arrow to call the 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 for this is to try to cut out the "rb-readline" gem of a later version, for example, 0.5.0, however, if I change the gem version in this way, I can’t even start the console, it will work as if readline had not been installed.

I know that there are many similar quastions here, but so far I have not been lucky with my rails / ruby ​​configuration. I will be grateful for any help, thanks in advance! Please pay attention to ruby ​​/ rails version before addressing other similar questions.

+4
source share
1 answer

I had a similar problem that was resolved by updating readline 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)
+1
source

All Articles