简体   繁体   English

无法在Bluemix Compose上为Postgresql使用Postgis

[英]Unable to use Postgis on Bluemix Compose for Postgresql

I have a Compose for Postgresql service on IBM Bluemix which isn't allowing me run PostGIS functions on my cloud foundry rails app. 我在IBM Bluemix上有一个Compose for Postgresql服务,该服务不允许我在我的Cloud Foundry Rails应用程序上运行PostGIS功能。 I have run "CREATE EXTENSION PostGIS;" 我已经运行了“ CREATE EXTENSION PostGIS;” and I have also added the adapter to database.yml. 并且我还将适配器添加到了database.yml中。 Compose for Postgresql says PostGIS comes installed by default Compose for Postgresql表示PostGIS默认安装

I am using Ruby on Rails with the rgeo gem and the error is 我在rgeo gem中使用Ruby on Rails,错误是

ERR NoMethodError: undefined method `st_point' for # ERR NoMethodError:#的未定义方法“ st_point”

Can you please let me know if there is anything I need to do to get PostGIS working? 您能否让我知道让PostGIS工作需要做些什么?

请提出支持请求,要求在撰写实例上启用postgis插件。

Answered my own question. 回答了我自己的问题。 The problem was with the rgeo gem and the adapter. 问题出在rgeo gem和适配器上。 I needed the postgis:// adapter for working with the gem. 我需要postgis://适配器才能使用gem。

Bluemix does not allow you to change the adapter in their connections. Bluemix不允许您更改适配器的连接。 It will always be postgresql. 它将始终是postgresql。 To get around this I set a CUSTOM_DATABASE_URL environment variable with the connection string postgis://<username>:<password>@host:port/<db_name> . 为了解决这个问题,我用连接字符串postgis://<username>:<password>@host:port/<db_name>设置了一个CUSTOM_DATABASE_URL环境变量。 Using the cf client this would look like 使用cf客户端,这看起来像

cf set-env <app-name> CUSTOM_DATABASE_URL postgis://<username>:<password>@host:port/<db_name>

Then in the command for my container in the manifest.yml, I prepended setting DATABASE_URL = CUSTOM_DATABASE_URL, specifically 然后在manifest.yml中用于我的容器的命令中,我预先设置了DATABASE_URL = CUSTOM_DATABASE_URL

DATABASE_URL=$CUSTOM_DATABASE_URL &&.....

Its a workaround for now until Bluemix allows us to change the adapter in the connections. 在Bluemix允许我们更改连接中的适配器之前,这是目前的解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法通过eclipse连接到在bluemix中创建的“针对PostgreSQL的数据库”数据库 - Unable to connect to “Compose for PostgreSQL” DB created in bluemix through eclipse 无法在CentOS 7上安装PostgreSQL 9.5 / PostGIS 2.3 - Unable to install PostgreSQL 9.5/PostGIS 2.3 on CentOS 7 PostgreSQL/PostGIS 无法在矩形多边形内搜索 - PostgreSQL/PostGIS unable to search inside a rectangle polygon 转换PostgreSQL中现有的JSON字段以在PostGIS中使用 - Converting existing JSON field in PostgreSQL to use in PostGIS 更改LC_CTYPE以使用PostgreSQL和PostGIS - Change LC_CTYPE for PostgreSQL and PostGIS use PostgreSQL + POSTGIS - Postgresql + POSTGIS 如何在PHP和postgresql / postgis代码中使用JavaScript Geojson对象作为图层 - How to use JavaScript Geojson object in PHP and postgresql/postgis code as a layer 密码验证失败-Postgis / PostgreSQL数据库使用geodjango - Password authentication failed- postgis/postgresql database to use geodjango 如何使用spring-boot和postgresql的postgis类型地理? - How to use postgis type Geography with spring-boot and postgresql? 在 MacOS 下使用 MacPorts 安装 PostgreSQL 12 / PostGIS 3.0 时,如何使用 postgis_restore.pl 脚本? - On a PostgreSQL 12 / PostGIS 3.0 installation with MacPorts under MacOS, how to use postgis_restore.pl script?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM