title: Ruby on Rails project with Postgres DB, created on Macbook, need to access on windows 10
body: <p>A while ago I created a Ruby on Rails project with a postgres database. It was originally created on a macbook where I had set up a working production and test environment. Unfortunately, this computer has died and now I have to continue working on the same project using the only machine I have: a Windows 10 laptop. </p>
  
  <p>I have been following these guides to set up a viable rails environment on my windows 10 pc:
  <a href="https://medium.com/@colinrubbert/installing-ruby-on-rails-in-windows-10-w-bash-postgresql-e48e55954fbf" rel="nofollow noreferrer">https://medium.com/@colinrubbert/installing-ruby-on-rails-in-windows-10-w-bash-postgresql-e48e55954fbf</a></p>
  
  <p><a href="https://gorails.com/setup/windows/10" rel="nofollow noreferrer">https://gorails.com/setup/windows/10</a></p>
  
  <p>I have installed bash/ubuntu successfully. I have installed git successfully. I have installed ruby successfully. I have installed all the pre-requisite gems so that I can run bundle install successfully. When I get to postgres, as suggested by both tutorials, I install it via windows instead of installing it by terminal. With Postgres 9.6 installed and running as a windows service, I'm unable to enter psql in the terminal. I get this error:</p>
  
  <p><em>psql: could not connect to server: No such file or directory
          Is the server running locally and accepting
          connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?</em></p>
  
  <p>Additionally, here are the errors that appear when I attempt to do something with rake db commands:</p>
  
  <p><em>FATAL:  role "xxx" does not exist
  Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"YelpClone_development", "host"=>"localhost"}
  rake aborted!
  ActiveRecord::NoDatabaseError: FATAL:  role "xxx" does not exist</em></p>
  
  <p>'xxx' above is my username. I'm not sure if its the username from my old mac or on my new windows machine. I've attempted to edit the database.yml inside my rails project but that gets the same results. </p>
  
  <p>Looking at <a href="https://stackoverflow.com/questions/11919391/postgresql-error-fatal-role-username-does-not-exist">this topic</a> about the role error, I attempted to use the command "sudo -u postgres -i" which results in another error:</p>
  
  <p><em>sudo: setresuid() [1000, 112, 1000] -> [-1, 0, -1]: Operation not permitted
  sudo: unable to set runas group vector: Operation not permitted
  sudo: unable to mkdir /var/run/sudo: Permission denied
  [sudo] password for xxx:
  sudo: PERM_ROOT: setresuid(0, -1, 0): Operation not permitted
  xxx is not in the sudoers file.  This incident will be reported.</em></p>
  
  <p>Once again 'xxx' is my username. Now I'm beginning to suspect that all this stuff did NOT install correctly. But I'm unsure how I can check. I've tried re-installing postgres about 5-6 times now. Can anyone shed some light on this mess?</p>