像其他一些人一样,当我在我的项目中运行rake db:migrate或者甚至为我的Ruby on Rails 3.2应用程序尝试大多数数据库任务时,我收到此错误.
PGError(无法连接到服务器:没有这样的文件或目录.服务器是否在本地运行并接受Unix域套接字上的连接"/tmp/.s.PGSQL.5432"?
很久以前我用Homebrew安装了PostgreSQL,并且在最近尝试安装MongoDB后,我的PostgreSQL安装从未如此.我正在运行OS X v10.6 Snow Leopard.
出了什么问题,我怎么能更好地理解PostgreSQL是如何设置在我的Mac上的呢?
到目前为止(我认为)这告诉我PostgreSQL没有运行(?).
ps -aef|grep postgres (ruby-1.9.2-p320@jct-ana) (develop) ?
501 17604 11329 0 0:00.00 ttys001 0:00.00 grep postgres
Run Code Online (Sandbox Code Playgroud)
但这是否告诉我PostgreSQL正在运行?
? launchctl load -w /usr/local/Cellar/postgresql/9.1.4/homebrew.mxcl.postgresql.plist (ruby-1.9.2-p136)
homebrew.mxcl.postgresql: Already loaded
Run Code Online (Sandbox Code Playgroud)
我该如何解决?我没看到什么?
PS:~/Library/LaunchAgents包含两个PostgreSQL .plist文件.我不确定这是否相关.
org.postgresql.postgres.plist
homebrew.mxcl.postgresql.plist
Run Code Online (Sandbox Code Playgroud)
我尝试了下面的结果,得到了如下结果.
$ psql -p 5432 -h localhost
psql: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on …Run Code Online (Sandbox Code Playgroud) 我通过Homebrew安装了Octave和gnuplot,并下载了AquaTerm.dmg.当我尝试绘图时,我收到以下消息:
octave:4> plot(x,y)
gnuplot> set terminal aqua enhanced title "Figure 1" font "*,6"
^
`line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list`
Run Code Online (Sandbox Code Playgroud)
在bash终端set terminal,set Terminal,set term,(和相同的,其次是"AQUA"太)等给予什么.我已经尝试从八度音阶再次绘制"AquaTerm"已经打开,但没有.我已经尝试直接从gnuplot绘图,但同样的问题..我怎么能这样做"设置终端aqua"?
Gnuplot启动消息说" Terminal type set to 'x11'"但不知道如何更改它,以前的命令也不起作用.
由于AquaTerm没有从Homebrew安装,也许octave/gnupot找不到它......但不知道.有什么猜测?谢谢!
我正在干净安装小牛队,不小心做了
brew install gcc
Run Code Online (Sandbox Code Playgroud)
这花了半个多小时,也许更多.我应该终止吗?我现在知道我应该安装一个特定的gcc(也许是gcc48)但是为时已晚,我的macbook空气呼吸困难.
目前已完成下载所有5个依赖项,但卡在"安装gcc"部分.它下载了一个gcc-4.9.1.tar.bz2,配置并构建它,并坚持制作引导程序.
任何建议表示赞赏.
这是我太晚看到的好建议:https://apple.stackexchange.com/questions/38222/how-do-i-install-gcc-via-homebrew
首先在这里问:https://superuser.com/questions/788256/brew-install-gcc-mac-os-10-9-mavericks
运行brew services start mongodb-community会产生:
Bootstrap failed: 5: Input/output error
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/<myUserName>/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist` exited with 5.
Run Code Online (Sandbox Code Playgroud)
当我跑步时launchctl load -w /Users/<myUserName>/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
产量
Load failed: 5: Input/output error
我最近将 macOS 升级到 BigSur 11.5.2。
我已经卸载并重新安装了自制程序和 xcode。
我在:OSX 10.11.6,Homebrew版本0.9.9m OpenSSL 0.9.8zg 2015年7月14日
我正在尝试使用dotnetcore并遵循他们的指示,
我升级/安装了最新版本的openssl:
> brew install openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2h_1.el_capitan.bottle.tar.gz
Already downloaded: /Users/administrator/Library/Caches/Homebrew/openssl-1.0.2h_1.el_capitan.bottle.tar.gz
==> Pouring openssl-1.0.2h_1.el_capitan.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, which means it was not symlinked into /usr/local.
Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries
Generally there are no consequences …Run Code Online (Sandbox Code Playgroud) 尝试从brew设置docker,但是引擎似乎不包含在任何官方公式中.
brew install docker-machine docker-compose
Run Code Online (Sandbox Code Playgroud)
那么这些只安装客户端?引擎/守护进程没有桶吗?
如何使用brew在macOS中安装以前版本的Python 3?
使用该命令brew install python我获得了最新版本的Python 3(目前是v3.7.0),但我想要最新版本的Python 3.6(目前是3.6.5).
我已经阅读了另一个pyenv可以帮助处理不同python安装的软件包,但是这个解决方案并不适合我.
安装Yosemite后,我无法运行brew或ruby.
我在brew更新时收到此错误:
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 23: /usr/local/Library/brew.rb: Undefined error: 0
Run Code Online (Sandbox Code Playgroud)
在irb上收到此错误:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in mkdir': Permission denied - /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14 (Errno::EACCES) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:infu_mkdir'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:219:in block (2 levels) in mkdir_p' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:inreverse_each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in block in mkdir_p' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:ineach'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in mkdir_p' from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:210:inwrite_gem_make_out'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:132:in build_error' from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:171:inrescue in build_extension'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:156:in build_extension' from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:198:inblock in build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in each' from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:inbuild_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1436:in block in build_extensions' from /Library/Ruby/Site/2.0.0/rubygems/user_interaction.rb:45:inuse_ui'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1434:in build_extensions' from …Run Code Online (Sandbox Code Playgroud) 重新启动MacBook Pro后,我无法启动数据库服务器:
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Run Code Online (Sandbox Code Playgroud)
我检查了日志,然后一遍又一遍地出现以下行:
FATAL: database files are incompatible with server
DETAIL: The data directory was initialized by PostgreSQL version 9.2, which is not compatible with this version 9.0.4.
Run Code Online (Sandbox Code Playgroud)
9.0.4是预装在mac上的版本,9.2 [.4]是我通过Homebrew安装的版本.如前所述,这曾经在重启之前工作,所以它实际上不是一个编译问题.我也重新运行initdb /usr/local/var/postgres -E utf8,文件仍然存在.
不幸的是,我对Postgres很新,所以任何帮助都会非常感激.
Homebrew需要/ usr/local中的权限,因为没有其他人使用我的笔记本电脑,我总是这样做
sudo chown -R $(whoami) $(brew --prefix)
但是在High Sierra,这给了
chown: /usr/local: Operation not permitted
修复是什么?