Update Postgres instructions for Ubuntu
We were getting an enconding exception when running `rake db:create`. This post from stackoverlow seems to fix it https://stackoverflow.com/questions/13115692/encoding-utf8-does-not-match-locale-en-us-the-chosen-lc-ctype-setting-requires
This commit is contained in:
@@ -83,6 +83,36 @@ You also need to configure a user for your database. As an example, we'll choose
|
|||||||
sudo -u postgres createuser consul --createdb --superuser --pwprompt
|
sudo -u postgres createuser consul --createdb --superuser --pwprompt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To make sure the UTF-8 enconding is used, create a file:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo nano /etc/profile.d/lang.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Add the following:
|
||||||
|
|
||||||
|
```
|
||||||
|
export LANGUAGE="en_US.UTF-8"
|
||||||
|
export LANG="en_US.UTF-8"
|
||||||
|
export LC_ALL="en_US.UTF-8"
|
||||||
|
```
|
||||||
|
|
||||||
|
Reconfigure Postgres to use the UTF-8 encoding:
|
||||||
|
|
||||||
|
`````
|
||||||
|
sudo su - postgres
|
||||||
|
psql
|
||||||
|
|
||||||
|
update pg_database set datistemplate=false where datname='template1';
|
||||||
|
drop database Template1;
|
||||||
|
create database template1 with owner=postgres encoding='UTF-8'
|
||||||
|
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
|
||||||
|
update pg_database set datistemplate=true where datname='template1';
|
||||||
|
|
||||||
|
\q
|
||||||
|
exit
|
||||||
|
`````
|
||||||
|
|
||||||
## Imagemagick
|
## Imagemagick
|
||||||
|
|
||||||
Install Imagemagick:
|
Install Imagemagick:
|
||||||
|
|||||||
@@ -83,6 +83,36 @@ Para el correcto funcionamiento de CONSUL, necesitas confgurar un usuario para t
|
|||||||
sudo -u postgres createuser consul --createdb --superuser --pwprompt
|
sudo -u postgres createuser consul --createdb --superuser --pwprompt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Para asegurarse que se utiliza la codificación con UTF-8, crea un archivo:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo nano /etc/profile.d/lang.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Añade las siguientes líneas:
|
||||||
|
|
||||||
|
```
|
||||||
|
export LANGUAGE="en_US.UTF-8"
|
||||||
|
export LANG="en_US.UTF-8"
|
||||||
|
export LC_ALL="en_US.UTF-8"
|
||||||
|
```
|
||||||
|
|
||||||
|
Reconfigura Postgres para utilizar la codificación UTF-8:
|
||||||
|
|
||||||
|
`````
|
||||||
|
sudo su - postgres
|
||||||
|
psql
|
||||||
|
|
||||||
|
update pg_database set datistemplate=false where datname='template1';
|
||||||
|
drop database Template1;
|
||||||
|
create database template1 with owner=postgres encoding='UTF-8'
|
||||||
|
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
|
||||||
|
update pg_database set datistemplate=true where datname='template1';
|
||||||
|
|
||||||
|
\q
|
||||||
|
exit
|
||||||
|
`````
|
||||||
|
|
||||||
## Imagemagick
|
## Imagemagick
|
||||||
|
|
||||||
Instala Imagemagick:
|
Instala Imagemagick:
|
||||||
|
|||||||
Reference in New Issue
Block a user