cyberdelia / heroku-geo-buildpack

Geo libraries for Heroku
https://github.com/heroku/heroku-geo-buildpack
114 stars 135 forks source link

error when pushing to heroku: line 73: [: too many arguments #20

Closed mgiraldo closed 8 years ago

mgiraldo commented 10 years ago

This is the first part of the trace when pushing:

-----> Fetching custom git buildpack... done
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/cyberdelia/heroku-geo-buildpack.git
=====> Detected Framework: geos/gdal/proj
       Using geos version: <?xml version="1.0" encoding="UTF-8"?>
       Using gdal version: 1.11.0
       Using proj version: 4.8.0
/tmp/buildpackOEjor/bin/compile: line 73: [: too many arguments
-----> Vendoring geo libraries done
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-ruby.git
=====> Detected Framework: Ruby
-----> Compiling Ruby/Rails
...
cyberdelia commented 10 years ago

Sorry, permission issue :cry: Could you try again?

mgiraldo commented 10 years ago

Pushing... (precompile takes a while)

mgiraldo commented 10 years ago

nope... same thing:

rake aborted!
Method Surface#centroid not defined.
/app/vendor/bundle/ruby/2.1.0/gems/rgeo-0.3.20/lib/rgeo/feature/surface.rb:99:in `centroid'

What other settings do I need in Heroku? I had a LD_LIBRARY_PATH env var set to /app/bin/geos/lib:/app/bin/proj/lib before pushing. Should I remove and re-push?

mgiraldo commented 10 years ago

To clarify: push goes through fine, it's the rake task that doesn't work. The rake task has a call to somePolygonGeometry.centroid

mgiraldo commented 10 years ago

the actual code that is being called is here: https://github.com/NYPL/building-inspector/blob/postgis/app/services/consensus_utils.rb#L135-139

this Heroku instance does not have PostGIS enabled but I understand this is not a requirement for rgeo. In my development machine the database is not PostGIS either. I query the data as GeoJSON and then do processing via rgeo.

cyberdelia commented 10 years ago

Could you try this: heroku run irb And see what RGeo::Geos.supported? returns?

mgiraldo commented 10 years ago

did this:

irb(main):002:0> require 'rgeo'
=> true
irb(main):003:0> RGeo::Geos.supported?
=> false
irb(main):004:0> 
mgiraldo commented 10 years ago

any ideas why this is not working?

cyberdelia commented 10 years ago

@mgiraldo Could you trying to push again after running heroku repo:purge_cache on your app (from https://github.com/heroku/heroku-repo) ?

mgiraldo commented 10 years ago

oh my! it is working now!!!!

thank you!

hayduke19us commented 9 years ago

@cyberdelia This fix worked for me as well. Thanks!

Rails 4.1.1 ruby 2.1.1 postgis

mgiraldo commented 8 years ago

a build that used to work is not working anymore

i did upgrade to Ruby 2.2.4

any idea?

i did the purge_cache and pushed and get:

irb(main):001:0> require 'rgeo'
=> false
irb(main):002:0> RGeo::CoordSys::Proj4.supported?
=> true
irb(main):003:0> RGeo::Geos.supported?
=> false
mgiraldo commented 8 years ago

this is my buildpacks file:

https://github.com/cyberdelia/heroku-geo-buildpack.git#1.3
https://github.com/heroku/heroku-buildpack-ruby.git#v138

at https://github.com/nypl-spacetime/building-inspector/blob/master/.buildpacks

and my BUILDPACK_URL: https://github.com/heroku/heroku-buildpack-multi.git

mgiraldo commented 8 years ago

upped the buildpack-ruby to v145 and still no luck :pensive:

mgiraldo commented 8 years ago

this worked: https://github.com/rgeo/rgeo/issues/125#issuecomment-189192788

but it feels like a hack... is there a more “official” way of doing it?

kunalbhatt commented 8 years ago

@mgiraldo did you end up ever working around this hack?

mgiraldo commented 8 years ago

i am now using the multi buildpack functionality native to heroku and using these buildpacks:

  1. https://github.com/peterkeen/heroku-buildpack-vendorbinaries.git
  2. https://github.com/diowa/heroku-buildpack-rgeo-prep.git
  3. heroku/ruby