PG :: InvalidParameterValue:错误:必须指定要安装的版本

时间:2015-06-11 13:53:03

标签: ruby-on-rails postgresql

尝试迁移Discourse数据库,但20120921162512_add_meta_data_to_forum_threads.rb似乎产生以下错误:

== 20120921162512 AddMetaDataToForumThreads: migrating ========================
-- execute("CREATE EXTENSION IF NOT EXISTS hstore")
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::InvalidParameterValue: ERROR:  version to install must be specified
: CREATE EXTENSION IF NOT EXISTS hstore/usr/home/www/_myapp/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `async_exec'
/usr/home/www/_myapp/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute'
...

1 个答案:

答案 0 :(得分:0)

解决此问题的最简单方法是让您的默认Postgres模板数据库已安装hstore扩展名,如下所示:

psql -d template1 -c 'create extension hstore;'

请参阅此答案,以获得详尽而详尽的解释:https://stackoverflow.com/a/11584751/483260