Sudo vim /etc/postgresql/9.5/main/pg_hba.conf set permissions etc to trust, peer or md5. connect /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/. Next to that, your firewalls must allow the access. Hi everybody, Im experiencing trouble when trying to use ruby-postgres with a. Things to check here are the listenaddresses and port parameters to be found in your nf They must match with what the clients specify. Your other sessions try to connect using network. Sudo -u postgres psql -c "SHOW data_directory" show the data directory. Since your local psql session just works, your database is OK. Sudo vim /etc/postgresql/9.5/main/nf where you go to change the port. Ps -fHC postgres prints all the postgres jobs and the file locations etc. This cloud tutorial will guide you through the process of configuring PostgreSQL for your Ruby on Rails application. Under Application and OS Images (Amazon Machine Image), choose. \conninfo prints the connection and port that the postgresql service is running on. Step 1: Create an EC2 instance Under Name and tags, for Name, enter ec2-database-connect. SELECT versions() prints the postgresql version from within psql \l lists the databases installed from within psql \dt lists the database tables from within psql Sudo -u postgres psql signs into psql as the default postgres user Sudo service postgresql restart restarts the postgresql server Note: Saving credentials in environment variables is convenient, but. Pg_hba.conf can be set to trust on all connections to bypass requiring a password at all. Initializes a Unix socket connection pool for a Cloud SQL instance of Postgres. It took about an hour to nail down the issue. Sticking with the one on ubuntu in the WSL. ![]() That reason could have been because I stupidly had postgres running on both windows and the windows subsystem for linux and both trying to accept traffic on localhost:5432. 33 Is my lucky number so something tells me I made this change for some stupid reason. the issue was postgresql was running on port 5433 instead of 5432. I thought I had a fresh install and everything. Here is a series of commands/thoughts/hates I went through when debugging WHY on earth rails could not connect to Postgresql.
0 Comments
Leave a Reply. |