我正在尝试构建一个rails应用程序并将其部署到heroku,我对所有这些都是非常陌生的,我正在遵循这个Getting started on Heroku我首先安装了heroku和postgresql,在命令行(Windows10)中我运行这个命令heroku login,然后rails new weather --database=postgresql,然后我cd进入天气文件夹,我运行rails db:create,我得到这个错误fe_sendauth: no password supplied Couldn't create 'weather_development' database. Please check your configuration. rails aborted! PG::ConnectionBad: fe_sendauth: no password supplied bin/rails:4:in `<main>' Tasks: TOP => db:create什么配置,配置文件在哪里?
发布于 2020-11-06 08:23:50
在Ubuntu上本地安装postgresql:
gemfile:
gem "pg"
控制台:
sudo apt install postgresql libpq-dev
sudo su postgres
createuser --interactive --pwprompt
username
password启动服务器:
rails db:create db:migrate
rails s不要在一个应用中同时安装sqlite和pg。
如果你有一个postgresql数据库在开发环境中工作,它肯定会在heroku中工作。
在推送到heroku之后,不要忘记运行heroku run rails db:migrate
https://stackoverflow.com/questions/64706477
复制相似问题