Home Install rails with WSL and postgresql
Reply: 1

Install rails with WSL and postgresql

S.Martignier Published in 2017-11-30 13:13:42Z

I'm trying to setup a rails environment development on a Windows 10.

I follow the tutorial of 'go_rails' (https://gorails.com/setup/windows/10)

Most of the installation seems to worked fine (when i type rby -v or rails -v in the bash it's return the expected result).

My issue is with postresql which is used for the project i work on it.

Following the instructions of the tutorial i install Postgresql (10) directly on Windows. It's seems to work since in can login using the pgadmin on windows or by typing 'psql -p 5432 -h localhost -U postgres' in the bash.

So it's look like postgresql is working, but when i do a rake db:create in bash, i got an error : could not connect to the server: No such file or directory. Is the server running locally and accepting connections on Unix domain socket '/var/run/postgresql/.s.PGSQL.5432'

In the postgresql.conf (C:/Programms/.../Data/postgresql.conf) the listen_addresses is set to '*'.

A bit after there is a line named '#unix_socket_directoris = ''', do you thing i should set something in there?

I really need to get that project work.

Thanks for your help

Jonathan P.
Jonathan P. Reply to 2017-12-15 16:39:19Z

The problem is likely that you've installed the Windows binary for PostgreSQL, but you're trying to connect to it from Windows Subsystem for Linux using a Unix socket, which doesn't exist.

You need to use TCP/IP to connect rather than a Unix socket. When typing psql on the command line, add the option --host= to connect via TCP/IP.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.297492 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO