简体   繁体   中英

Rails - OS Mavericks and postgresql

Background - a few months ago, I purchased a new Macbook to replace an iMac. When I restored my data from my old iMac to the new Macbook, I accidentally used davidburton as the user when on the iMac I was burtondav .

I was then not able to run postgreSQL or Rails.

I used this symlink command to fix it:

ln -s /Users/davidburton /Users/burtondav

But, yesterday I upgraded to OS X Mavericks. Now I can't start postgreSQL or use Rails. Even after re-entering the symlink.

Is there any way to fix it???

If I have to re-install postgreSQL:

My postgreSQL files are in usr/local/var/postgres I'm pretty sure I used homebrew to install it.

How can I re-install postgreSQL without loosing my data?

I was going to dump the whole database and reload after I reinstall postgreSQL. But I can't start postgreSQL in order to dump the data.

This is what I get:

$ postgres -D /usr/local/var/postgres
2013-10-24 15:30:07 GMT <  > %FATAL:  data directory   "/usr/local/var/postgres" has wrong ownership
2013-10-24 15:30:07 GMT <  > %HINT:  The server must be started by the  user that owns the data directory.

Should I change the ownership from burtondav to davidburton?

Thanks for your help!!

You should change the owner of the postgres data directory:

chown davidburton /user/local/var/postgres
# or
sudo chmod ugo=rwX /user/local/var/postgres # You might want to change the permissions as your needs

(You might need to use sudo )

You didn't post the error when you try to start rails/postgres, maybe this question can help you: ERROR: Failed to build gem native extension on Mavericks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM