ruby-on-rails 如何使用termux在Rails应用程序中启用PostgreSQL

qv7cva1a  于 2022-11-19  发布在  Ruby
关注(0)|答案(1)|浏览(321)

我尝试在termux中创建一个ruby on rails应用程序,我已经安装了必要的gem和软件包,但是在执行rails db:create时,我得到了这个错误

rails aborted!
ActiveRecord::ConnectionNotEstablished: connection to server on socket "/data/data/com.termux/files/usr/tmp/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
Caused by:
PG::ConnectionBad: connection to server on socket "/data/data/com.termux/files/usr/tmp/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
deyfvvtc

deyfvvtc1#

您需要手动启动PostgreSQL服务器,以便您的应用程序能够连接到。
通过pkg install postgresql安装postgresql
有关示例设置说明https://wiki.termux.com/wiki/Postgresql,请参阅wiki

相关问题