mix-deploy-example icon indicating copy to clipboard operation
mix-deploy-example copied to clipboard

Error: 'C.UTF-8' is not a supported language or locale

Open joepstender opened this issue 6 years ago • 4 comments

Following the blogpost Deploying an Elixir app to Digital Ocean with mix_deploy, I run into the following error on the step: sudo bin/build-install-deps-ubuntu ===> Installing locale C.UTF-8 Error: 'C.UTF-8' is not a supported language or locale

joepstender avatar Apr 20 '20 20:04 joepstender

I had to: sudo vim /etc/default/locale Then paste the following:

LANGUAGE="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

Save the file. Logout and login again.

joepstender avatar Apr 20 '20 20:04 joepstender

C.UTF-8 ended up not being well supported, so I switched to en_US.UTF-8 (or en_US.utf8) in my latest scripts. I think this should have already been fixed.... can you make sure you are running the latest code and see if it still occurs?

reachfh avatar Apr 21 '20 11:04 reachfh

Yeah I tried again and this still occurs, now this time I used Ubuntu 20.04 (LTS) x64, could that cause the issue? Strange because bin/build-install-deps-ubuntu indeed has:

# Make sure we have a good LANG
export LANG="${LANG:-en_US.UTF-8}"

joepstender avatar Feb 04 '21 19:02 joepstender

The issue is that your OS install does not have the locale defined. I guess it's super minimal. That's why I was trying to use C.UTF-8, but even that name is not consistent between Linux distros.

You can define the en_US.UTF-8 locale with something like:

sudo localedef -i en_US -f UTF-8 en_US.UTF-8

Or maybe

localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

reachfh avatar Feb 06 '21 02:02 reachfh