Encoding issues while doing bundle install

Hey Guys,

I was working on my web app while this bug
(https://github.com/rails/rails/issues/4259) was giving me hard time. So
I
decided to try fixing it myself. I cloned rails from github; while doing
bundle install I was facing some unicode encoding issues, stack trace:
https://gist.github.com/raw/4384230/9d174ae0aa3f4f32302f7c9af9d08d5dd44ba0a2/gistfile1.sh

I did a quick google search and ended up with this
post:


on
stack overflow

As it fixed issue with bundle install at my local dev environment, it
made me wonder why is it not already done. So, I quickly created a
branch
and pushed it to my forked rails repository.

diff: https://github.com/idlecool/rails/compare/bundler_encoding

This seems to be very trivial issue, but not fixed. I was going to make
a
pull request but decided to post it here instead for more clarity.
Should I
go ahead and make a pull request or is there something wrong with my
local
ruby/rvm installation.

Thanks,
Shiv.
Developer, HackerRank.com

On Wed, Dec 26, 2012 at 6:28 PM, Shiv D. [email protected] wrote:

As it fixed issue with bundle install at my local dev environment, it made
me wonder why is it not already done. So, I quickly created a branch and
pushed it to my forked rails repository.

diff: https://github.com/idlecool/rails/compare/bundler_encoding

This seems to be very trivial issue, but not fixed. I was going to make a
pull request but decided to post it here instead for more clarity. Should I
go ahead and make a pull request or is there something wrong with my local
ruby/rvm installation.

It isn’t done because it shouldn’t have to be, it’s more or less your
systems job to inform Ruby what your encoding preference is. Even
though I would love to say that UTF-8 is the encoding for the entire
world I can’t and I can say that enforcing UTF-8 would be an
anti-pattern (to me) even if it’s the preferred. If you are on Linux
or Unix read the following… if you are on Windows you are on your
own because I know about as much about Windows as actually I don’t
really know much about Windows other than the lowlevel userland API’s.

[9:12:55] [email protected]:~ % export LANG=“en_US.BROKEN”
[9:13:00] [email protected]:~ % ruby -e ‘p ENCODING
#Encoding:US-ASCII

[9:13:02] [email protected]:~ % export LANG=“en_US.UTF-8”
[9:13:09] [email protected]:~ % ruby -e ‘p ENCODING
#Encoding:UTF-8

[9:14:20] [email protected]:~ % export LANG=“en_US.BROKEN”
[9:14:24] [email protected]:~ % export LC_CTYPE=“en_US.UTF-8”
[9:14:31] [email protected]:~ % printenv |grep -P LANG|LC_
LANG=en_US.BROKEN
LC_CTYPE=en_US.UTF-8
[9:14:50] [email protected]:~ % ruby -e ‘p ENCODING
#Encoding:UTF-8

Make sure LANG and/or LC_CTYPE are set.
LC_CTYPE=“en_US.UTF-8”
LANG=“en_US.UTF-8”

Some applications expect LC_CTYPE some expect LANG some will expect
either or and LC_CTYPE overrides LANG.

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