Not able to install hstore in rails 4 on CENTOS
我使用rails 4和数据库作为postgres9.4。使用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:inasync_exec' block 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:592:in
/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:inblock in log' instrument'
/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
/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:inlog' 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:592:in
/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:inexecute_and_clear' 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/database_statements.rb:160:in
/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:inenable_extension' block in method_missing'
/var/www/Q3/mailchimp/campaign_app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:662:in
我试试
1 2 | sudo yum install postgresql postgresql-contrib sudo yum install postgresql-server.x86_64 postgresql94-contrib.x86_64 |
但不要为我工作
在Centos我错误地安装了postgres8.3软件包,但我使用的是postges9.4。
删除postgres8.3包后,它工作正常