DETAIL: The chosen LC_CTYPE setting requires encoding "LATIN1"

1,596 views
Skip to first unread message

Marcin Lewandowski

unread,
Jul 20, 2015, 1:16:49 PM7/20/15
to phoeni...@googlegroups.com
Hello,

I keep getting this error while trying to run tests:

** (Mix) The database for RadioKitMixer.Repo couldn't be created, reason given: "ERROR:  encoding \"UTF8\" does not match locale \"en_US\"\nDETAIL:  The chosen LC_CTYPE setting requires encoding \"LATIN1\".\n".

Can anyone help me in overcoming this?

Here are my locale settings:

vagrant@trusty64:/vagrant$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

Here are my versions:

vagrant@trusty64:/vagrant$ cat mix.lock | grep ecto
  "ecto": {:hex, :ecto, "0.14.1"},
  "phoenix_ecto": {:hex, :phoenix_ecto, "0.4.0"},
vagrant@trusty64:/vagrant$ cat mix.lock | grep phoenix
  "phoenix": {:hex, :phoenix, "0.14.0"},
  "phoenix_ecto": {:hex, :phoenix_ecto, "0.4.0"},
  "phoenix_html": {:hex, :phoenix_html, "1.2.1"},
  "phoenix_live_reload": {:hex, :phoenix_live_reload, "0.4.3"},

Thanks a lot

Marcin

Steve Domin

unread,
Jul 20, 2015, 3:03:08 PM7/20/15
to phoeni...@googlegroups.com
Hi Marcin,

This probably happens because you installed Postgres after having configure the locales.

Try uninstalling postgres, running the following command and then installing it again:

$ export LANGUAGE=en_US.UTF-8
$
export LANG=en_US.UTF-8
$ export LC_ALL=en_US.UTF-8
$ locale-gen en_US.UTF-8
$ dpkg-reconfigure locales

Marcin Lewandowski

unread,
Jul 21, 2015, 8:36:44 AM7/21/15
to phoeni...@googlegroups.com
It worked, thank you!

m.
Reply all
Reply to author
Forward
0 new messages