无法在CENTOS上的rails 4中安装hstore [关闭]

我使用rails 4和数据库作为postgres9.4 . 使用hstore类型列为动态字段 . 我收到错误

PG :: UndefinedFile:错误:无法打开扩展控制文件“/usr/pgsql-9.4/share/extension/hstore.control”:没有这样的文件或目录:CREATE EXTENSION IF NOT NOT EXISTS“hstore”/ var / www / Q3 / mailchimp / campaign_app / vendor / bundle / ruby / 2.2.0 / gems / activerecord-4.2.1 / lib / active_record / connection_adapters / postgresql_adapter.rb:592:in async_exec'/ var / www / Q3 / mailchimp / campaign_app / vendor / bundle / ruby / 2.2.0 / gems / activerecord-4.2.1 / lib / active_record / connection_adapters / postgresql_adapter.rb:592:inblock in exec_no_cache'/ var / www / Q3 / mailchimp / campaign_app / vendor / bundle / ruby /2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:473:in log in log'/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0 /gems/activesupport-4.2.1/lib/active_support/notifications/instrumenter.rb:20:in instrument'/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2 .1 / lib / active_record / connection_adapters / abstract_adapter.rb:467:在log'/ var / www / Q3 / mailchimp / campaign_app / vendor / bundle / ruby / 2.2.0 / gems / activerecord-4.2.1 / lib / active_record / connection_adapters / postgresql_adapter.rb:592:inexec_no_cache'/ var / www / Q3 / mailchimp / campaign_app / vendor / bundle /ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:584:incute_and_clear'/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0 /gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:in exec_query'/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0/gems/activerecord -4.2.1 / lib / active_record / connection_adapters / postgresql_adapter.rb:342:in enable_extension'/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib /active_record/migration.rb:662:在method_missing中的块中

我试试

sudo yum install postgresql postgresql-contrib
sudo yum install postgresql-server.x86_64 postgresql94-contrib.x86_64

但不要为我工作

回答(1)

2 years ago

在Centos我错误地安装了postgres8.3软件包,但我使用的是postges9.4 . 删除postgres8.3包后,它工作正常