Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 钢轨和jsonb型;jsonb";不存在_Ruby On Rails_Postgresql_Jsonb - Fatal编程技术网

Ruby on rails 钢轨和jsonb型;jsonb";不存在

Ruby on rails 钢轨和jsonb型;jsonb";不存在,ruby-on-rails,postgresql,jsonb,Ruby On Rails,Postgresql,Jsonb,我通过这样的迁移添加了一个jsonb列 psql --version psql (PostgreSQL) 9.4.1 rails -v Rails 4.2.0 有什么帮助吗?环顾四周后,通过运行正确的命令,我发现我的postgresql版本不是9.4 PG::UndefinedObject: ERROR: type "jsonb" does not exist LINE 1: SELECT 'jsonb'::regtype::oid 因此,我只需将我的postgresql升级到9.4 顺

我通过这样的迁移添加了一个jsonb列

psql --version
psql (PostgreSQL) 9.4.1

rails -v
Rails 4.2.0

有什么帮助吗?

环顾四周后,通过运行正确的命令,我发现我的postgresql版本不是9.4

PG::UndefinedObject: ERROR:  type "jsonb" does not exist
LINE 1: SELECT 'jsonb'::regtype::oid
因此,我只需将我的postgresql升级到9.4

顺便说一句,我随后做了升级,我觉得非常方便

现在:


希望这能对同样情况的人有所帮助。

前几天我也看到了这个问题,似乎没有任何解决办法。你能尝试升级到4.2.1或降低你的级别吗rails@argentum47我认为这是我的错,我会修正它,并张贴答案。谢谢。正确。升级postgresql版本会有所帮助。该指南适用于大多数debian系统,但对于Ubuntu14.04(它没有postgres-9.4包/存储库),还需要做更多的工作。对于较旧版本的Ubuntu,请在askubuntu.com上搜索,因为那里有太多的解决方案。对于其他遇到此问题的人,我使用并成功地在Ubuntu 14.04上直接从Postgres 9.3升级到10.5。这篇文章适用于9.4->9.5,但在9.3->10.5中效果很好!以下是在Ubuntu 14.04上安装postgres-9.4的指导说明
PG::UndefinedObject: ERROR:  type "jsonb" does not exist
LINE 1: SELECT 'jsonb'::regtype::oid
postgres=# SHOW SERVER_VERSION;
server_version 
----------------
9.1
postgres=# SHOW SERVER_VERSION;
 server_version 
----------------
 9.4.1