i'm new to ruby on rails, i'm trying to run an app with postgres database, but it didn't work, i have tried to search lots of information, but i wasn't useful, Someone posted the exactly same question here Problems with rails server , I tried to use command rails new blog
it created an app with sqlite3 database, it works fine, but i created app with command rails new myapp --database=postgresql
after that i visit localhost page, it ocurred the exactly same error
could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Can anyone help? it would be very much appreciated.
database.yml file information:
default: &default
adapter: postgresql
encoding: unicode
pool: 5
development:
<<: *default
database: myapp_development
test:
<<: *default
database: myapp_test
production:
<<: *default
database: myapp_production
username: myapp
password: <%= ENV['MYAPP_DATABASE_PASSWORD'] %>