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

时间:2015-12-10 12:44:14

标签: ruby-on-rails postgresql centos

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

  

PG :: UndefinedFile:错误:无法打开扩展控制文件   “/usr/pgsql-9.4/share/extension/hstore.control”:没有这样的文件或   目录:CREATE EXTENSION如果不存在   “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: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: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/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'   method /missing中的/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 块“

我试试

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

但不适合我

1 个答案:

答案 0 :(得分:0)

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