homebrew-postgresql
homebrew-postgresql copied to clipboard
While installing postgresql@11: configure: error: header file <perl.h> is required for Perl
==> ./configure --prefix=/usr/local/Cellar/postgresql@11/11.0 --enable-dtrace --enable-nls --with-bonjour --with-gssa
Last 15 lines from /Users/hajhatten/Library/Logs/Homebrew/postgresql@11/01.configure:
checking for library containing bind_textdomain_codeset... -lintl
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for msgfmt... /usr/local/opt/gettext/bin/msgfmt
checking for msgfmt flags... -c
checking for msgmerge... /usr/local/opt/gettext/bin/msgmerge
checking for xgettext... /usr/local/opt/gettext/bin/xgettext
checking for tclsh... /usr/local/opt/tcl-tk/bin/tclsh
checking for tclConfig.sh... /usr/local/Cellar/tcl-tk/8.6.8/lib/tclConfig.sh
checking tcl.h usability... yes
checking tcl.h presence... yes
checking for tcl.h... yes
checking for perl.h... no
configure: error: header file <perl.h> is required for Perl
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/petere/homebrew-postgresql/issues
These open issues may also help:
Fully qualified name petere/postgresql/postgresql@10 is needed to install correct formula https://github.com/petere/homebrew-postgresql/issues/40
OSX Mojave 10.14 (18A391) Homebrew 1.7.7 Homebrew/homebrew-core (git revision 5e88c5; last commit 2018-10-23) Homebrew/homebrew-cask (git revision 5c3b4; last commit 2018-10-23)
Earlier had 10.5 installed, but ran:
brew uninstall postgresql --force
brew tap petere/postgresql
brew install postgresql@11
Same issue here, with [email protected].
Possible duplicate of https://github.com/petere/homebrew-postgresql/issues/41, which has a workaround, if you don't need plpgsql support.
And a more thorough workaround if you do (brew edit [email protected], add depends_on "perl" and add perl to deps = ...).
This simple workaround by @jsgillen1 worked nicely, without need for brew edit.
This is what finally worked for me. Open the folder /Library/Developer/CommandLineTools/Packages/ and manually install macOS_SDK_headers_for_macOS_10.14.pkg. Postgres install worked fine after that.
Hitting this now with 11.2_1 -> 11.3 in Ubuntu WSL
checking for perl.h... no configure: error: header file <perl.h> is required for Perl
Perl is installed, though:
/home/linuxbrew/.linuxbrew/Cellar/perl/5.28.1 (2,654 files, 71.3MB) * Poured from bottle on 2019-01-04 at 10:33:17
There's a perl.h inside /usr/lib/x86_64-linux-gnu/perl/5.26.1/CORE/perl.h
I tried to export LIBRARY_PATH="/usr/lib/x86_64-linux-gnu/" but that didn't help.
Still receiving this error in Catalina. Reinstalling CLTools doesn't work because /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg no longer exists in Catalina so there seems to be no current workaround.
Update: the brew edit workaround does not work with postgresql @11 or @12. Fortunately, I was able to get postgresql 11.5 installed successfully from brew by downloading Xcode 11.2 Beta placing it in my /Applications folder, and running (as root) sudo xcode-select --switch /Applications/Xcode-beta.app/ After that, I could brew install postgresql without any Perl errors.
This was fixed for me on Catalina just by installing XCode via the app store, phew!
Still receiving this error in Catalina. Reinstalling CLTools doesn't work because
/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkgno longer exists in Catalina so there seems to be no current workaround.Update: the
brew editworkaround does not work with postgresql@11or@12. Fortunately, I was able to get postgresql 11.5 installed successfully from brew by downloading Xcode 11.2 Beta placing it in my /Applications folder, and running (as root)sudo xcode-select --switch /Applications/Xcode-beta.app/After that, I couldbrew install postgresqlwithout any Perl errors.
You are right, Catalina does not have the header file, but my system version is 10.15, aka, it doesn't have /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.15.pkg
After installing XCode from App Store, the error was still there, however, running sudo xcode-select --switch /Applications/Xcode.app/ helped.
Thanks a lot, now I can brew install postgresql smoothly!!