加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

PostgreSQL安装hstore

发布时间:2020-12-13 17:17:07 所属栏目:百科 来源:网络整理
导读:PostgreSQL安装hstore 搭建rubygems.org 这个项目,执行迁移 # rake db:migrate RAILS_ENV=development 时候遇到一个错误 错误信息: -- enable_extension("hstore") rake aborted! StandardError: An error has occurred,this and all later migrations can

PostgreSQL安装hstore


搭建rubygems.org 这个项目,执行迁移 # rake db:migrate RAILS_ENV=development 时候遇到一个错误

错误信息:

-- enable_extension("hstore")
rake aborted!
StandardError: An error has occurred,this and all later migrations canceled:


PG::UndefinedFile: 错误: 无法打开扩展控制文件 "/usr/share/pgsql/extension/hstore.control": 没有那个文件或目录
: CREATE EXTENSION IF NOT EXISTS "hstore"/usr/local/rvm/gems/ruby-2.1.6/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:596:in `async_exec'


原因:要启用hstore扩展,但是我的环境中没有安装


解决方法:
安装缺失的hostore ,而hostore是postgresql-contrib 的东西 ,所以安装postgresql-contrib

命令:# yum installpostgresql-contrib-9.2.13-1.el7_1.x86_64

继续执行迁移任务 : #rake db:migrate RAILS_ENV=development


OK了,项目可以正常启动了

如果平时使用可以到postgresql数据库 启动 # psql 安装hstore扩展
postgres=# create extension hstore;
CREATE EXTENSION
postgres=# 


参考链接: http://www.postgresguide.com/sexy/hstore.html
http://www.cnblogs.com/gaojian/p/3351294.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读