Rails server start error: Invalid Multibyte char

I am getting this error while starting server. Can someone help me debug
the cause?

$ rails s

/home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails/railtie.rb:3:in
require': /home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-3.2.15/lib/*active_support/inflector.rb:1: invalid multibyte char (UTF-8) (SyntaxError)* from /home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails/railtie.rb:3:in<top (required)>’
from
/home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails/engine.rb:1:in
require' from /home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails/engine.rb:1:in<top (required)>’
from
/home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails/plugin.rb:1:in
require' from /home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails/plugin.rb:1:in<top (required)>’
from
/home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails/application.rb:3:in
require' from /home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails/application.rb:3:in<top (required)>’
from
/home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails.rb:10:in
require' from /home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails.rb:10:in<top (required)>’
from
/home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails/all.rb:1:in
require' from /home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails/all.rb:1:in<top (required)>’
from /code/rails_projects/bigb1/config/application.rb:3:in require' from /code/rails_projects/bigb1/config/application.rb:3:in<top
(required)>’
from
/home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails/commands.rb:53:in
require' from /home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails/commands.rb:53:inblock in <top (required)>’
from
/home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails/commands.rb:50:in
tap' from /home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails/commands.rb:50:in<top (required)>’
from script/rails:6:in require' from script/rails:6:in

Hi,

On 23 Νοε 2013, at 12:08 , Ankur K. [email protected] wrote:

invalid multibyte char (UTF-8) (SyntaxError)

In your application use above the shebang line # encoding: UTF-8

Also set-up utf-8 for erb files Encoding.default_external = “UTF-8”

These two should do the trick.

regards

Panagiotis (atmosx) Atmatzidis

email: [email protected]
URL: http://www.convalesco.org
GnuPG ID: 0x1A7BFEC5
gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5

I thought ruby 2 already dealt with it properly, but, anyways, you can
try
and add

#encoding: UTF-8

on the top of your ruby file and see if it helps.

2013/11/23 Ankur K. [email protected]

from
require' /home/ankur/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.15/lib/rails.rb:10:in from /code/rails_projects/bigb1/config/application.rb:3:inrequire’
`tap’


Thyago Barbosa Rodrigues [Natal-RN/Brasil]

“Who loves not wine, women and song,
remains a fool his whole life long”
(Martin Luther [Martinho Lutero], Telogo Alemo)

“Phantasie ist wichtiger als Wissen, denn Wissen ist begrenzt.” (Albert
Einstein)

One correction, I think "Encoding.default_external = “UTF-8” needs to be
added in application.rb file. I see following added by default in my
file.



# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"


Thanks.


Regards,
Ankur

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs