Error: No such keg: /usr/local/Cellar/ail - postgresql

I'm trying to install psql on Mac (M1). I'm following this tutorial.
I'm in this step: brew link --force libpq ail, but I get the error Error: No such keg: /usr/local/Cellar/ail. How can I fix this?

It seems to be a typo. I tried the commented suggestion brew link --force libpq and it worked.

Related

Error installing postgresql through homebrew

I was able to install homebrew with no issues, but when I try to install postgresql I get the below error messages:
➜ ~ brew install postgresql
Warning: No available formula with the name "postgresql".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
screen shot of error messages
Any idea how to fix this?
git -C $(brew --repo homebrew/core) checkout master
this will switch to master, then run
brew doctor
this should run without any error.
If there is no error you can install anything with brew install.
ex:
brew install postgresql

Failed to install mongo db in Mac Big Sur

I am a newbie in mongo db and trying to install in my Mac Big Sur OS. It is a public beta OS.
While install the Mongo DB, I am getting the below error:
Error: An exception occurred within a child process:
NoMethodError: undefined method 'path' for nil:NilClass
Did you mean paths?
I have the latest Xcode installed. The steps I followed are from Official MongoDB documentation url.
Please help if there is a solution.
My case wasn't with installing MongoDB, but had the same problem when installing Vault using Homebrew.
After running brew doctor, my problem was with outdated Command Line Tools.
I followed the instruction shown in the error message.
However, the first solution didn't updated my command line tools.
$ softwareupdate --all --install --force
So I followed the second solution, and was able to install Vault successfully.
$ sudo rm -rf /Library/Developer/CommandLineTools
$ sudo xcode-select --install

Error while installing mongodb-community using Homebrew

Hello, i'm getting this error while i'm trying to install MongoDB using Homebrew.
Updating Homebrew...
==> Installing mongodb-community from mongodb/brew
Error: An exception occurred within a child process:
NoMethodError: undefined method `path' for nil:NilClass
Did you mean? paths
your help please!
After several trying and searching in web, i resolved finally the problem just by installing the last version of xcode command line tools.
I literally faced the same issue today morning, I installed all software updates and nothing worked. Someone mentioned using brew update nothing.
softwareupdate --all --install --force
Running brew doctor asked to clear out command-line tools and reinstall xcode
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
I did the same, followed by installing mongo community edition, it worked!

brew services start mongodb-community#4.0 fails - uninitialized constant

I've followed the directions on the MongoDB docs to install MongoDB on Mac using homebrew:
brew tap mongodb/brew
brew install mongodb-community#4.0
Then I can run it in the foreground using:
mongod --config /usr/local/etc/mongod.conf
But, when trying to start it as a service using:
brew services start mongodb-community#4.0
I get this error:
Error: mongodb-community: uninitialized constant #<Class:0x00007ff189061008>::Gem
I also get this error when running brew doctor:
Warning: Some installed formulae are not readable:
mongodb-community: uninitialized constant #<Class:0x00007ffd903152a0>::Gem
Why this is happening? How do I fix it?
Thank you!
This is an error with the mongodb-community formula. An issue has been filed with the maintainers, a solution found, and a pull request with the fix opened.
In the meantime, you can fix the error yourself. This line in the formula is throwing an exception:
Gem::Version.new(v['version'])
because the Gem class has not been imported. Adding the import:
require 'rubygems'
solves the problem. You can do this locally, by finding and editing the formula on your computer. It is probably in this file:
/usr/local/Homebrew/Library/Taps/mongodb/homebrew-brew/Formula/mongodb-community.rb
Update: A community contributor has fixed this upstream. If you are still experiencing this issue you might need to run brew update
I know it's not correct answer since we are talking about registering service using:
brew services start mongodb-community
But I've SOLVED service registration question this way:
sudo cp /usr/local/Cellar/mongodb-community/4.0.9/homebrew.mxcl.mongodb-community.plist /Library/LaunchAgents/
launchctl load -w /Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
launchctl start mongodb-community

How to solve the error of Postgresql Client not installed on Ubuntu 18.04

Just install the Postgresql on Ubuntu 18.04 and having the error of PostgreSQL client
Warning: No existing local cluster is suitable as a default target.
Please see man pg_wrapper(1) how to specify one.
Error: You must install at least one postgresql-client-<version> package
I tried all the solutions that are on the StackOverflow and other forums but not succeed to solve the error
Following are the solutions that I tried
1. psql --cluster 10/apps [other arguments]
when I try the first solution it give me the error
Error: Invalid version 10 specified with --cluster
2. psql -p 5432
3. sudo apt-get install postgresql-client-10
when try the third solution it shows the following
postgresql-client-10 is already the newest version (10.5-0ubuntu0.18.04).
4. gedit ~/.bashrc
PATH=/usr/local/pgsql/bin:$PATH
export PATH
Can someone tell what the exact solution to solve the error.
Your 3rd solution is almost there, make sure to run sudo apt-get install postgresql-10 too.