重启我的Mac后,我遇到了可怕的Postgres错误:
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"?
Run Code Online (Sandbox Code Playgroud)
发生这种情况的原因是因为我的macbook完全因为一个无关的问题而冻结,我不得不使用电源按钮进行硬重启.重新启动后,由于此错误,我无法启动Postgres.
当我尝试运行时,rails console我收到此错误:
/Users/TuzsNewMacBook/.rvm/gems/ruby-2.3.7/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require':
dlopen(/Users/TuzsNewMacBook/.rvm/rubies/ruby-2.3.7/lib/ruby/2.3.0/x86_64-darwin18/readline.bundle, 9):
Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
Run Code Online (Sandbox Code Playgroud)
快速搜索让我看到这篇文章,我尝试了一些事情:
brew reinstall postgresql (这确实是这个项目的数据库)
和
cd /usr/local/opt/readline/lib
ln libreadline.8.0.dylib libreadline.6.2.dylib
Run Code Online (Sandbox Code Playgroud)
(我的readline版本是8)
和
brew link readline --force
但这些都没有解决它.
我最近添加了pry-coolline,guard并且guard-livereloadgems到我的项目,如果这有任何区别(rails控制台在那之前加载好).我正在使用最新的macos.
(更新)我使用pry rails作为我的rails控制台,如果这有任何区别.
有帮助吗?谢谢.
在Mac OS X 10.8.4上遇到PostgreSQL的一些问题.brew rm postgresql --force当postgres服务器运行时我不小心做了.当我安装使用brew install postgresql并运行时,pg_ctl -D /usr/local/var/postgres start我得到:
pg_ctl: another server might be running; trying to start server anyway
server starting
FATAL: lock file "postmaster.pid" already exists
HINT: Is another postmaster (PID 752) running in data directory "/usr/local/var/postgres"?
Run Code Online (Sandbox Code Playgroud)
当我运行"ps -ef | grep postgres"时,我得到:
501 752 235 0 12:42PM ?? 0:00.01 /usr/local/opt/postgresql/bin/postgres -D /usr/local/var/postgres -r /usr/local/var/postgres/server.log
501 754 752 0 12:42PM ?? 0:00.00 postgres: checkpointer process
501 755 752 0 12:42PM …Run Code Online (Sandbox Code Playgroud) 我正在使用Mac,Sierra 10.12.3,我正在尝试通过psql命令访问PostgreSQL数据库,但它抛出了错误
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
Referenced from: /usr/local/bin/psql
Reason: image not found
Abort trap: 6
Run Code Online (Sandbox Code Playgroud)
一两天前,我和某人合作,我需要安装pip,所以我跑了brew install pip,一切都很好.这是我psql从那时起第一次尝试运行,我不确定这与我的问题有什么关系,但似乎可能因为我没有做任何其他更改.
现在我做了一点侦探工作,发现如果我去了/usr/local/opt/那里确实有一个readline指向的别名目录/usr/local/Cellar/readline/7.0.1(版本7.0.1似乎也在某些时候安装了 - 也许是pip的一部分?也许我错误地做了...)所以它有一定意义,应该抛出原始错误.我将别名更改为指向/usr/local/Cellar/readline/6.3.8并且错误稍有改变:
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
Referenced from: /usr/local/bin/psql
Reason: no suitable image found. Did find:
/usr/local/opt/readline/lib/libreadline.6.dylib: stat() failed with errno=20
Abort trap: 6
Run Code Online (Sandbox Code Playgroud)
所以我好像在某个地方,但仍然有问题.如果有人能够对解决方案有所了解,我将永远感激不尽.
我正在尝试安装Valet,但由于错误,我从brew卸载了php,现在我重新安装了php,如果我转到apache上的phpinfo()文件,我可以看到
PHP版本7.1.23
但是,如果我php -v在控制台上执行操作,或执行其他php命令,则会得到:
dyld:未加载库:/usr/local/opt/readline/lib/libreadline.7.dylib引用自:/ usr / local / bin / php原因:找不到映像中止陷阱:6
我在Mac Os Sierra上