无法在 CENTOS 上的 rails 4 中安装 hstore

Not able to install hstore in rails 4 on CENTOS

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

PG::UndefinedFile: ERROR: could not open extension control file "/usr/pgsql-9.4/share/extension/hstore.control": No such file or directory : CREATE EXTENSION IF 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 block 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:in 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:in execute_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:in block in method_missing'

我试试

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

但对我不起作用

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