This buildpack overwrites Heroku's default .bundle/config to set BUNDLE_BUILD__RGEO to Heroku's build directory.
This is needed because projects are actually built somewhere like
.vendor_urls file in the root of your project:
Add this file to git and make sure it ends with a newline.
Now, set up your Heroku configuration:
heroku buildpacks:set https://github.com/diowa/heroku-buildpack-rgeo-prep.git heroku buildpacks:add https://github.com/peterkeen/heroku-buildpack-vendorbinaries.git heroku buildpacks:add heroku/ruby heroku config:set LD_LIBRARY_PATH=/app/lib
If you haven't already set up your Heroku database for postgis, you need to run the following steps. You currently must have a production level database to enable postgis.
Since postgis uses different settings in the database.yml, you need to modify the
DATABASE_URL variable. Run the following command and extract the necessary components out of it:
$ heroku config:get DATABASE_URL postgres://<username>:<password>@<host>:<port>/<database>
With those variables, run the following command
$ heroku config:set DATABASE_URL="postgis://<username>:<password>@<host>:<port>/<database>?postgis_extension=true&search_schema_path=public,postgis"
$ heroku pg:psql => CREATE EXTENSION postgis;
git push heroku master
Verify it worked
$ heroku run console >> RGeo::Geos.supported? => true >> RGeo::CoordSys::Proj4.supported? => true
If both of these are true, you should be ready to go.
This solution draws from many people's research including
Copy the snippet above into CLI.