【问题标题】:PG::InvalidParameterValue: ERROR: version to install must be specifiedPG::InvalidParameterValue: 错误:必须指定要安装的版本
【发布时间】:2015-06-11 13:53:03
【问题描述】:

尝试迁移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'
...

【问题讨论】:

    标签: ruby-on-rails postgresql


    【解决方案1】:

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

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

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

    【讨论】:

      猜你喜欢
      • 2019-07-11
      • 1970-01-01
      • 1970-01-01
      • 2020-10-01
      • 2020-09-29
      • 2016-05-11
      • 2016-09-30
      • 1970-01-01
      • 2019-04-13
      相关资源
      最近更新 更多