Skip to content

Latest commit

 

History

History
108 lines (64 loc) · 2.16 KB

INSTALAR.rdoc

File metadata and controls

108 lines (64 loc) · 2.16 KB

SIG@

Manual instalacao do sistema.

Software

  • Ruby >= 1.8.7/1.9.x

  • PostgreSQL >= 8.3.x

  • PostGIS >= 1.3.x

Extra:

  • Thin/Ngnix or Passenger

  • ImageMagick

  • GIT

Gems

gem install rails postgres postgis_adapter haml authlogic bcrypt-ruby\
paperclip GeoRuby rghost will_paginate nofxx-money

Desenvolvedores

Test

gem install rspec rspec-rails nofxx-object_daddy faker

PostgreSQL

Se seu banco ja usa UTF8, pule essa parte.

Criar um banco UTF8:

export PGROOT="/var/lib/postgres"
mkdir -p $PGROOT/data && chown postgres.postgres $PGROOT/data

# Arch
su - postgres -c "/usr/bin/initdb -E utf8 --locale=en_US.UTF-8 $PGROOT/data"

# Debian
su - postgres -c "/usr/bin/postgresql/8.3/initdb -E utf8 --locale=en_US.UTF-8 $PGROOT/data"

# Ubuntu
su - postgres -c "/usr/lib/postgresql/8.3/bin/initdb -E utf8 --locale=en_US.UTF-8 $PGROOT/data"

PostGIS

Instalando PostGIS e criando um template:

Execute o terminal do PostgreSQL, exemplo:

su postgres
psql template1

No terminal do postgresql, crie o template e a linguagen plpgsql:

create database template_postgis with template = template1;
UPDATE pg_database SET datistemplate = TRUE where datname = 'template_postgis';
\c template_postgis
CREATE LANGUAGE plpgsql;

Importando as funcoes, agora os comandos divergem entre SOs. Alguns exemplos:

# archlinux
\i /usr/share/lwpostgis.sql;
\i /usr/share/spatial_ref_sys.sql;

# centos x86_64
\i /usr/share/pgsql/contrib/lwpostgis-64.sql
\i /usr/share/pgsql/contrib/spatial_ref_sys.sql

# debian e ubuntu
\i /usr/share/postgresql-8.3-postgis/lwpostgis.sql;
\i /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql;

# osx
\i /opt/local/postgis/lwpostgis.sql;
\i /opt/local/postgis/spatial_ref_sys.sql;

Finalizando:

GRANT ALL ON geometry_columns TO PUBLIC;
GRANT ALL ON spatial_ref_sys TO PUBLIC;
VACUUM FREEZE;

Criando o Banco

$ createdb -O <owner> -T template_postgis siga_development

Troque <owner> pelo user do banco. Repetir para test e production.

Rails

Copie o database.yml.sample:

cp config/database.yml.sample config/database.yml

Migre:

rake db:migrate