Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/74.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
Sinatra和PostgreSQL-运行整个数据库和应用程序_Sql_Postgresql_Sinatra - Fatal编程技术网

Sinatra和PostgreSQL-运行整个数据库和应用程序

Sinatra和PostgreSQL-运行整个数据库和应用程序,sql,postgresql,sinatra,Sql,Postgresql,Sinatra,我一直在努力将我的应用程序从MAC操作系统重新运行到windows操作系统。我从来都不喜欢数据库。不管怎么说,问题是我连种子都装不上。看起来它无法运行pg gem方法。这是我的错误 :in `ensure in run': undefined method `close' for nil:NilClass (NoMethodError) 下面是该方法被卡住的代码 require_relative('../models/collection') require_relative('../mode

我一直在努力将我的应用程序从MAC操作系统重新运行到windows操作系统。我从来都不喜欢数据库。不管怎么说,问题是我连种子都装不上。看起来它无法运行pg gem方法。这是我的错误

:in `ensure in run': undefined method `close' for nil:NilClass (NoMethodError)
下面是该方法被卡住的代码

require_relative('../models/collection')
require_relative('../models/product')
require('pry')

Product.delete_all()
Collection.delete_all()


fw2015 = Collection.new({
 'name' => 'Fall Winter 2015/2016'
 })

fw2015.add()

我很确定这是跟博士后有关的。感谢您的帮助

这是一个gem问题,不是PostgreSQL问题。这可能与创业板中存在二元部分这一事实有关,它们可能没有建造权。因此,您需要确保已安装PostgreSQL客户端库和头文件,并且已安装所有必要的编译器


尝试卸载并重新安装gem,查看出现了哪些错误和警告。

我尝试重新安装pg gem,但在运行seeds.rb文件时遇到了相同的错误。我曾尝试在我的windows操作系统笔记本电脑上安装postgreSQL,所以可能是数据库本身的运行问题?不,安装过程一切顺利