首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在heroku cedar上安装GEOS

在heroku cedar上安装GEOS
EN

Stack Overflow用户
提问于 2013-06-03 17:39:47
回答 2查看 786关注 0票数 3

我们在heroku雪松堆栈上安装GEOS库时遇到了麻烦。

我们遵循了这个指南:https://devcenter.spacialdb.com/Heroku.html,但它不起作用。

我们注意到存储在提供的geos二进制文件中的路径(/app/tmp/geos)是错误的,所以我们用vulcan构建了我们自己的二进制文件。

我们相应地更改了参数(BUNDLE_BUILD__RGEO),但我们无法使其工作。

我们甚至在自定义的rgeo gem中硬编码了geos路径,但都没有成功。

我们也尝试过其他构建脚本(https://github.com/roximity/heroku-buildpack-ruby-geos),但它们太旧了,很难使它们与heroku的构建脚本保持同步

我们使用的是ruby 2.0.0-p195和Rails 3.2.13

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-06-08 21:32:38

我刚刚创建了heroku-buildpack-rgeo-prep来解决这个问题。

此构建包覆盖.bundle/config以将BUNDLE_BUILD__RGEO设置为当前构建路径。不幸的是,您不能设置BUNDLE_BUILD_RGEO=/app,因为您的项目实际上是在/tmp/build_1890cktlpat5d这样的地方构建的。

希望这个构建包能大大减轻在Heroku上使用RGeo的痛苦。

票数 0
EN

Stack Overflow用户

发布于 2020-11-20 03:04:36

当前RGeo gem的维护者之一。我们正在改进文档,我已经编辑了the part mentioning geos installation on heroku

为了避免任何链接腐烂,这里有一个应该有效的解决方案:

代码语言:javascript
复制
echo 'libgeos-dev=3.7.1-1~pgdg18.04+1' > Aptfile # Use the version you want here
git add Aptfile
git commit -m 'Add Aptfile with libgeos'
heroku buildpacks:add --index=1 heroku-community/apt
# If you already have installed the gem earlier, you will need to purge your repo cache:
#   heroku plugins:install heroku-repo
#   heroku repo:purge_cache
git push heroku main
heroku console <<< 'puts "RGeo is configured with Geos !" if RGeo::Geos.capi_supported?;exit'

如果您还希望获得标准地理库(如Proj4)的支持,则应该考虑使用heroku-geo-buildpack。这会有点慢,而且你会有一个更大的插件,因为它会安装你可能不需要的库。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16893840

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档