简体   繁体   English

Rails-OS Mavericks和Postgresql

[英]Rails - OS Mavericks and postgresql

Background - a few months ago, I purchased a new Macbook to replace an iMac. 背景-几个月前,我购买了新的Macbook来代替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 . 当我将数据从旧的iMac还原到新的Macbook时,在iMac上是burtondav时,我意外地使用davidburton作为用户。

I was then not able to run postgreSQL or Rails. 然后,我无法运行postgreSQL或Rails。

I used this symlink command to fix it: 我使用此symlink命令对其进行了修复:

ln -s /Users/davidburton /Users/burtondav

But, yesterday I upgraded to OS X Mavericks. 但是,昨天我升级到了OS X Mavericks。 Now I can't start postgreSQL or use Rails. 现在,我无法启动postgreSQL或使用Rails。 Even after re-entering the symlink. 即使重新输入符号链接。

Is there any way to fix it??? 有什么办法可以解决???

If I have to re-install postgreSQL: 如果我必须重新安装postgreSQL:

My postgreSQL files are in usr/local/var/postgres I'm pretty sure I used homebrew to install it. 我的postgreSQL文件位于usr / local / var / postgres中,我敢肯定我用自制软件安装了它。

How can I re-install postgreSQL without loosing my data? 如何在不丢失数据的情况下重新安装postgreSQL?

I was going to dump the whole database and reload after I reinstall postgreSQL. 重新安装postgreSQL之后,我将转储整个数据库并重新加载。 But I can't start postgreSQL in order to dump the data. 但是我无法启动postgreSQL来转储数据。

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? 我应该将所有权从burtondav更改为davidburton吗?

Thanks for your help!! 谢谢你的帮助!!

You should change the owner of the postgres data directory: 您应该更改postgres数据目录的所有者:

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 ) (您可能需要使用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 当您尝试启动Rails / postgres时,您没有发布错误,也许这个问题可以为您提供帮助: 错误:无法在Mavericks上构建gem native扩展

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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