L
L
l2p2014-02-17 08:37:03
Ruby on Rails
l2p, 2014-02-17 08:37:03

How to set up Russian language in Ruby on Rails?

When entering a type string through the rails console,
g = "Привет"
an invalid multibyte char (UTF-8) error pops up.
Through the site, too, Russian words are not added. How can I fix this? I put i18n, but for some reason nothing has changed. Tell me please.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
_
_ _, 2014-02-17
@AMar4enko

# encoding: utf-8
at the very beginning of each file that uses Russian characters

K
Kirill Chernyshov, 2014-02-17
@delaguardo

When starting the application, set the environment variable RUBYOPT=-Ku
RUBYOPT=-Ku

V
Viktor, 2014-02-18
@vick

What version of ruby?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question