在Heroku上使用Postgres与Sails.js时出错

时间:2015-08-08 13:12:25

标签: postgresql heroku sails.js waterline sails-postgresql

提前感谢您的帮助。

帆:~0.10.0

DB:Postgres使用sails-postgresql adapter

我已成功将我的Sails应用程序部署到Heroku,并且能够在浏览器中连接到它。但是,我尝试使用蓝图或使用我的api创建任何数据,我收到以下错误

2015-08-08T12:59:48.540049+00:00 app[web.1]: Lowering sails...
2015-08-08T12:59:48.540921+00:00 app[web.1]: Shutting down socket server...
2015-08-08T12:59:48.581335+00:00 app[web.1]: npm ERR! Linux 3.13.0-49-generic
2015-08-08T12:59:48.587661+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2015-08-08T12:59:48.587787+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2015-08-08T12:59:48.540339+00:00 app[web.1]: Sent kill signal to child process (26)...
2015-08-08T12:59:48.544026+00:00 app[web.1]: /app/node_modules/sails-postgresql/lib/adapter.js:393
2015-08-08T12:59:48.544029+00:00 app[web.1]:         Object.keys(collection.schema).forEach(function(schemaKey) {
2015-08-08T12:59:48.544032+00:00 app[web.1]:                ^
2015-08-08T12:59:48.544033+00:00 app[web.1]: TypeError: Object.keys called on non-object
2015-08-08T12:59:48.544035+00:00 app[web.1]:     at Function.keys (native)
2015-08-08T12:59:48.544036+00:00 app[web.1]:     at __CREATE__ (/app/node_modules/sails-postgresql/lib/adapter.js:393:16)
2015-08-08T12:59:48.544038+00:00 app[web.1]:     at after (/app/node_modules/sails-postgresql/lib/adapter.js:1206:7)
2015-08-08T12:59:48.544039+00:00 app[web.1]:     at /app/node_modules/sails-postgresql/lib/adapter.js:1100:7
2015-08-08T12:59:48.544041+00:00 app[web.1]:     at /app/node_modules/sails-postgresql/node_modules/pg/lib/pool.js:77:9
2015-08-08T12:59:48.544042+00:00 app[web.1]:     at /app/node_modules/sails-postgresql/node_modules/pg/node_modules/generic-pool/lib/generic-pool.js:281:11
2015-08-08T12:59:48.544044+00:00 app[web.1]:     at /app/node_modules/sails-postgresql/node_modules/pg/lib/pool.js:51:18
2015-08-08T12:59:48.544046+00:00 app[web.1]:     at null.<anonymous> (/app/node_modules/sails-postgresql/node_modules/pg/lib/client.js:149:7)
2015-08-08T12:59:48.544047+00:00 app[web.1]:     at g (events.js:199:16)
2015-08-08T12:59:48.544048+00:00 app[web.1]:     at emit (events.js:129:20)
2015-08-08T12:59:48.544050+00:00 app[web.1]:     at TLSSocket.<anonymous> (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:109:12)
2015-08-08T12:59:48.544051+00:00 app[web.1]:     at TLSSocket.emit (events.js:107:17)
2015-08-08T12:59:48.544052+00:00 app[web.1]:     at readableAddChunk (_stream_readable.js:163:16)
2015-08-08T12:59:48.544054+00:00 app[web.1]:     at TLSSocket.Readable.push (_stream_readable.js:126:10)
2015-08-08T12:59:48.544055+00:00 app[web.1]:     at TCP.onread (net.js:538:20)

我无法在数据库中创建任何数据。当我远程连接到我的Heroku Postgres数据库时,我也注意到没有创建任何表。我的配置中缺少什么?

1 个答案:

答案 0 :(得分:2)

升级到风帆v11,一切正常。谢谢@ vitaly-t