I am in the process of building a rails app with geospatial capabilities. For this to work I need to install Postgis and enable its extension is the master and slave database. I have seen some solutions for doing such but would like some definitive direction. Please share your experiences for doing such.Thanks
--You received this message because you are subscribed to the Google Groups "rubber" group.To unsubscribe from this group and stop receiving emails from it, send an email to rubber-ec2+...@googlegroups.com.For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "rubber" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubber-ec2/msT5zvAqXh4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rubber-ec2+...@googlegroups.com.
Hi,Your best best bet is to modify the generated config/rubber/deploy-postgresql.rb file. In the bootstrap task, right after the "CREATE DATABASE" call, you'll want to add something like:sudo -i -u postgres psql -c 'CREATE EXTENSION "postgis"' #{env.db_name}
Since PostGIS requires an extra package to be installed, you'll need to add that to your config/rubber/rubber-postgresql.yml, too.In the "packages" section, you'll want to add something like:packages: ["postgresql-#{postgresql_ver}", "postgresql-contrib-#{postgresql_ver}", "postgis"]
sudo apt-get` call. that call needs to ends up specifying both postgis and the binding of a version to the postgresql version `install -y postgis postgresql-9.3-postgis-2.1`A few add-ons for postgis:On Sunday, July 26, 2015 at 7:53:40 PM UTC+2, Kevin Menard wrote:Hi,Your best best bet is to modify the generated config/rubber/deploy-postgresql.rb file. In the bootstrap task, right after the "CREATE DATABASE" call, you'll want to add something like:sudo -i -u postgres psql -c 'CREATE EXTENSION "postgis"' #{env.db_name}sudo -i -u postgres psql -c 'CREATE SCHEMA "postgis"' #{env.db_name}sudo -i -u postgres psql -c 'CREATE EXTENSION "PostGIS" WITH SCHEMA postgis' #{env.db_name}sudo -i -u postgres psql -c 'SET search_path "public, postgis"' #{env.db_name}sudo -i -u postgres psql -c 'GRANT ALL ON postgis.spatial_ref_sys TO PUBLIC' #{env.db_name}sudo -i -u postgres psql -c 'GRANT ALL ON postgis.geometry_columns TO PUBLIC' #{env.db_name}Since PostGIS requires an extra package to be installed, you'll need to add that to your config/rubber/rubber-postgresql.yml, too.In the "packages" section, you'll want to add something like:packages: ["postgresql-#{postgresql_ver}", "postgresql-contrib-#{postgresql_ver}", "postgis"]This turns out to be incomplete in my experience.A tid-bit: the process will load 9.4 versions when rubber-psotgresql.yml statespostgresql_ver: 9.3postgis_ver: 2.1# postgresql_ver: 9.4packages: ["postgresql-client-#{postgresql_ver}", libpq-dev, "postgresql-contrib-#{postgresql_ver}", "postgis", "postgresql-#{postgresql_ver}-postgis-#{postgis_ver}"]
** [out :: production.foo.com] Setting up postgresql-9.3-postgis-scripts (2.1.8+dfsg-5~97.git43a09cc.pgdg14.04+1) ...** [out :: production.foo.com]** [out :: production.foo.com] Setting up postgresql-client-9.4 (9.4.4-1.pgdg14.04+1) ...Stating postgis alone is not sufficient. Without digging into the code I assumed this is translated into an `sudo apt-get` call.that call needs to ends up specifying both postgis and the binding of a version to the postgresql version`install -y postgis postgresql-9.3-postgis-2.1`
Stating postgis alone is not sufficient. Without digging into the code I assumed this is translated into an `sudo apt-get` call.that call needs to ends up specifying both postgis and the binding of a version to the postgresql version`install -y postgis postgresql-9.3-postgis-2.1`Can you elaborate on what you mean? Everything from that packages list will be installed in a single 'apt-get install' command, much like you're showing here. The versions are bound: "postgresql-#{postgresql_ver}-postgis-#{postgis_ver}" will do variable interpolation taking the values from the YAML configuration above. In this case, it'll resolve to "postgresql-9.3-postgis-2.1", which seems to align with what you think it should be.
StandardError: An error has occurred, this and all later migrations canceled:undefined method `point' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition:0x000000053b7978>/mnt/ride-production/shared/bundle/ruby/1.9.1/gems/rgeo-activerecord-0.5.0/lib/rgeo/active_record/common_adapter_elements.rb:107:in `method_missing'