【发布时间】:2014-12-08 23:33:50
【问题描述】:
因此,自从优胜美地升级以来,我在尝试让我的 postgresql 数据库在我的 Rails 应用程序上运行时仍然遇到问题。我希望我现在永远不会升级。我在网上搜索过,stackoverflow 上有一个关于这个问题的相关问题。
`pg_tblspc` missing after installation of latest version of OS X (Yosemite or El Capitan)
我在命令行上遇到同样的错误。
No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
在我的网络浏览器中,它给了我 PG::ConnectionBad 错误。
我通过添加三个丢失的目录pg_tblspc,pg_twophase,pg_stat_tmp 解决了@Donovan 为解决问题而提出的解决方案,出于某种原因优胜美地摆脱了这些目录。我运行了所有正确的命令行操作,但仍然收到相同的错误并且没有运气。这也是我的 database.yml 文件的样子。
# PostgreSQL. Versions 8.2 and up are supported.
#
# Install the pg driver:
# gem install pg
# On Mac OS X with macports:
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
# On Windows:
# gem install pg
# Choose the win32 build.
# Install PostgreSQL and put its /bin directory on your path.
#
# Configure Using Gemfile
# gem 'pg'
#
development:
adapter: postgresql
encoding: unicode
database: task_manager_development
pool: 5
# Connect on a TCP socket. Omitted by default since the client uses a
# domain socket that doesn't need configuration. Windows does not have
# domain sockets, so uncomment these lines.
# host: localhost
# port: 5432
# Schema search path. The server defaults to $user,public
#schema_search_path: myapp,sharedapp,public
# Minimum log levels, in increasing order:
# debug5, debug4, debug3, debug2, debug1,
# log, notice, warning, error, fatal, and panic
# The server defaults to notice.
#min_messages: warning
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: postgresql
encoding: unicode
database: task_manager_test
pool: 5
production:
adapter: postgresql
encoding: unicode
database: task_manager_production
pool: 5
我也尝试取消注释掉本地主机和端口 5432,但仍然没有运气。我在这里真的需要帮助。基本上我在网上阅读的所有其他内容也都说添加这些多个目录并重新启动你的 postgresql 应该可以解决问题,但它对我没有用。我一定没有正确地做某事或遗漏了什么。我正在考虑重新安装自制软件和 ROR,但我担心我可能会丢失我的 ROR 应用程序中的所有数据。任何帮助都会很棒!
【问题讨论】:
-
你考虑过从源代码安装吗? (如果你安装在你的主目录下,那也会更简单:
./configure --prefix=/Users/your_user/opt;make;make install。)我一直在推迟升级...... -
你的意思是从我的rails应用程序的源或目录重新启动postgresql?
-
您可能还想检查提到的各种文件和目录的权限/所有权。
-
我该怎么做? @DmitriGoldring?
-
使用 'ls -l' 列出 db 目录(您在其中创建这些目录)中的文件,您应该会看到一个用户名和一个组(该组可能是人员)。确保用户名与目录中的其他文件匹配。如果没有,您可以使用 chown 命令来修复所有权。权限位于“ls”输出的开头,并且还应与其余目录匹配。
标签: ruby-on-rails postgresql osx-yosemite