Home Brew install package getting could not resolve HEAD to a revision - macos

I just installed the latest homebrew with version Homebrew 2.7.3. I have git pre-install on my Mac OS, and I was trying to install brew install git-crypt & brew install git-gui and getting an error on fatal: Could not resolve HEAD to a revision. It looks like it failed on any packages.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "git-crypt".
==> 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.
I tried uninstall then re-install homebrew using their command line : https://github.com/homebrew/install#uninstall-homebrew
By running brew doctor, I am getting some warnings :
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3-config
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8-config
Warning: Some taps are not on the default git origin branch and may not receive
updates. If this is a surprise to you, check out the default branch with:
git -C $(brew --repo homebrew/core) checkout master
I checked this directory
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
and realize there's no Formula folder.
Any help would be appreciate.

I had this error and solved with
git -C $(brew --repo homebrew/core) checkout master

Related

Homebrew error while trying to install pyenv

I recently installed Homebrew via terminal, but I get some errors when I try to use it to install other programs.
This is an example situation when I try to install pyenv.
brew install pyenv
This is the output of above command:
Running `brew update --preinstall`...
Warning: No available formula with the name "ca-certificates".
==> 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.
Error:
homebrew-cask is a shallow clone.
To `brew update`, first run:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
This command may take a few minutes to run due to the large size of the repository.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!
Error: pyenv: undefined method `cellar' for #<BottleSpecification:0x00007fd7720b4360>
I had the exact same problem.
What solved my issue on macOS Monterey 12.1 was to investigate the problem with brew doctor and then do as the output recommended.
The output of brew doctor informed me that the homebrew/homebrew-core hasn't been tapped properly and recommended the following commands:
rm -rf "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
Then I just continued with Pyenv's installation process and everything worked.

Installing Homebrew + nginx + rtmp in macOS Movaje 10.14

I was able to install Homebrew + nginx + rtmp in macOS High Sierra 10.13. Now I want do the same on macOS Mojave 10.14.
So let's start ... istallation of Homebrew, first we need Xcode in terminal...
xcode-select –install
than. We need homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
than install nginx + rtmp
And here's the problem
I tried:
brew install nginx-full --with-rtmp-module
but it won't work
the result:
Updating Homebrew...
Usage: brew install [options] formula
Install formula. Additional options specific to formula may be appended to the command.
Unless HOMEBREW_NO_INSTALL_CLEANUP is set, brew cleanup will then be run for
the installed formulae or, every 30 days, for all formulae.
-d, --debug If brewing fails, open an interactive
debugging session with access to IRB or a
shell inside the temporary build directory.
--env If std is passed, use the standard build
environment instead of superenv. If super
is passed, use superenv even if the formula
specifies the standard build environment.
--ignore-dependencies An unsupported Homebrew development flag to
skip installing any dependencies of any
kind. If the dependencies are not already
present, the formula will have issues. If
you're not developing Homebrew, consider
adjusting your PATH rather than using this
flag.
--only-dependencies Install the dependencies with specified
options but do not install the formula
itself.
--cc Attempt to compile using the specified
compiler, which should be the name of the
compiler's executable, e.g. gcc-7 for GCC
7. In order to use LLVM's clang, specify
llvm_clang. To use the Apple-provided
clang, specify clang. This option will
only accept compilers that are provided by
Homebrew or bundled with macOS. Please do
not file issues if you encounter errors
while using this option.
-s, --build-from-source Compile formula from source even if a
bottle is provided. Dependencies will still
be installed from bottles if they are
available.
--force-bottle Install from a bottle if it exists for the
current or newest version of macOS, even if
it would not normally be used for
installation.
--include-test Install testing dependencies required to
run brew test formula.
--devel If formula defines it, install the
development version.
--HEAD If formula defines it, install the HEAD
version, aka. master, trunk, unstable.
--fetch-HEAD Fetch the upstream repository to detect if
the HEAD installation of the formula is
outdated. Otherwise, the repository's HEAD
will only be checked for updates when a new
stable or development version has been
released.
--keep-tmp Retain the temporary files created during
installation.
--build-bottle Prepare the formula for eventual bottling
during installation, skipping any
post-install steps.
--bottle-arch Optimise bottles for the specified
architecture rather than the oldest
architecture supported by the version of
macOS the bottles are built on.
-f, --force Install without checking for previously
installed keg-only or non-migrated
versions.
-v, --verbose Print the verification and postinstall
steps.
--display-times Print install times for each formula at the
end of the run.
-i, --interactive Download and patch formula, then open a
shell. This allows the user to run
./configure --help and otherwise
determine how to turn the software package
into a Homebrew package.
-g, --git Create a Git repository, useful for
creating patches to the software.
-h, --help Show this message.
Error: invalid option: --with-rtmp-module
so i tried:
brew install nginx --with-rtmp-module
but.....result:
Updating Homebrew...
Error: No available formula with the name "–with-rtmp-module"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
so I decided to try install nginx first and than rtmp module
brew install nginx
and than i tried:
brew install nginx libnginx-mod-rtmp (copying from Linux)
brew install rtmp-module
brew install module-rtmp
But none of the above worked. How do I resolve it?
You should tap a nginx formulae before try install nginx-full
Well you can try denji/nginx, since homebrew/nginx tap has been deprecated, That's:
brew tap denji/nginx
then
brew install nginx-full --with-rtmp-module
That works for me.

how to install gcc-arm-none-eabi at Mojave MacOS

i'm now using MacOS Mojave.
i want to use gcc-arm-none-eabi for ergodox.
but i cannot install it by brew.
vikke#kosanji:~/vcswork/qmk_firmware
[master]$ brew search gcc-arm-none-eabi
No formula or cask found for "gcc-arm-none-eabi".
Closed pull requests:
gcc-arm-none-eabi 8-2019-q3-update (new formula) (https://github.com/Homebrew/homebrew-core/pull/45780)
gcc-arm-embedded 9-2019-q4-major (new formula) (https://github.com/Homebrew/homebrew-core/pull/46584)
WIP: arm-none-eabi-gcc 8-2018-q4-major (new formula) (https://github.com/Homebrew/homebrew-core/pull/39869)
libelf: remove libelf and dependents (https://github.com/Homebrew/homebrew-core/pull/39871)
libelf 0.8.12 (downgrade to solve linkrot) (https://github.com/Homebrew/homebrew-core/pull/39910)
Revert "Update gcc-arm-embedded to 6-2017-q1" (https://github.com/Homebrew/homebrew-cask/pull/30433)
Update gcc-arm-embedded to 6_2-2016q4,20161216 (https://github.com/Homebrew/homebrew-cask/pull/28143)
arm-none-eabi-gcc 20150921 (new formula) (https://github.com/Homebrew/legacy-homebrew/pull/45236)
Adding recipe for Pebble SDK 2.0-BETA5 (https://github.com/Homebrew/legacy-homebrew/pull/24834)
vikke#kosanji:~/vcswork/qmk_firmware
[master]$ brew install gcc-arm-none-eabi
Error: No available formula with the name "gcc-arm-none-eabi"
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
Error: No similarly named formulae found.
==> Searching taps on GitHub...
==> Searching for similarly named formulae...
==> Searching taps...
Error: No formulae found in taps.
How to do it?
i resolved.
download https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads and install.
If you got here looking for a way to install arm-none-eabi-gcc on macos, use the ARMmbed brew formulae:
brew install armmbed/formulae/arm-none-eabi-gcc
Homebrew does not work all the time. If you are on an older mac it is also likely that your operating system version is no longer supported by Homebrew.
So for people who are not having success with the other answers, Arm provide a proper signed macOS packaged version of the arm-none-eabi-gcc tool chain here
https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads

rbenv install giving me a Build Failed

I am having issues getting ruby-build to work through rbenv. When I run rbenv install 2.2.2 (or any other version) I get the following output:
Downloading ruby-2.2.4.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.bz2 Installing ruby-2.2.4...
BUILD FAILED (Ubuntu 16.04 using ruby-build 20170201-7-g5d62e84)
Inspect or clean up the working tree at /tmp/ruby-build.20170227230105.17714 Results logged to /tmp/ruby-build.20170227230105.17714.log
Last 10 log lines:
removed 'conf17793.dir/conf17793.file'
removed 'conf17793.file'
config.guess already exists
config.sub already exists
checking build system type... config.sub: too many arguments
Try `config.sub --help' for more information.
configure: error: /bin/bash tool/config.sub x86_64-pc-linux-gnu
removed '/tmp/cg1RYI8Z/dummy.c' removed '/tmp/cg1RYI8Z/dummy.o' failed
removed 'confdefs.h' removed directory '/opt/rbenv/versions/2.2.4/lib'
removed directory '/opt/rbenv/versions/2.2.4'
The full logs are not much longer but I will post them here just in case they are relevant:
/tmp/ruby-build.20170227230105.17714 /opt/rbenv
removed 'ruby-2.2.4.tar.bz2'
/tmp/ruby-build.20170227230105.17714/ruby-2.2.4 /tmp/ruby-build.20170227230105.17714 /opt/rbenv
removed 'conf17793'
removed 'conf17793.dir/conf17793.file'
removed 'conf17793.file'
config.guess already exists
config.sub already exists
checking build system type... config.sub: too many arguments
Try `config.sub --help' for more information.
configure: error: /bin/bash tool/config.sub x86_64-pc-linux-gnu
removed '/tmp/cg1RYI8Z/dummy.c'
removed '/tmp/cg1RYI8Z/dummy.o' failed
removed 'confdefs.h'
I searched online and haven't seen anyone else getting this error in relation to ruby-build or rbenv.
I will also explain my setup and how I installed rbenv just to give as much info as possible.
I am running Ubuntu 16.04 and cloned the rbenv repo to my /opt directory. sudo git clone https://github.com/rbenv/rbenv.git /opt. I added the rbenv set up lines to my .proflie file.
export RBENV_ROOT="/opt/rbenv/"
if [ -d "${RBENV_ROOT}" ]; then
export PATH="${RBENV_ROOT}/bin:${PATH}"
eval "$(rbenv init -)"
fi
I then cloned the ruby-build repo git clone https://github.com/rbenv/ruby-build.git /opt/rbenv/plugins/ruby-build
I then created a new group called ruby (that my user is in.) and recursively set it as the group for all of /opt/rbenv so now it's owned by root:ruby.
After all that rbenv appears to be working, I can run commands like rbenv versions (It shows system and 1.9.3-p0 which I installed manually) and rbenv local 1.9.3-p0. With no problem. I can also run rbenv install -l and get a full list with no problem so they both appeared to be installed properly.
If anyone can give me any ideas of what might be going wrong when I try to install a ruby version I would greatly appreciate it.
I found the problem. rbenv install downloads the ruby versions specfied then run the ./configure --prefix=/path/to/rbenv/versions/2.2.2. This is the command that was failing. After looking into one of the versions I downloaded that failed installing and going through it's configure script it was using a script called config.guess to determine the system type. This script creates some temporary files and deletes them. This would normally be fine but I have a custom rm command in my path, it does a few things but one of those things is to add the verbose flag. This was muddying the output of the config.guess script and breaking things later in the .configure script that were dependent on the output of this script. I fixed this by removing the verbose flag from my custom rm command and just placing it in a an alias.
Short answer (TLDR):
I had a custom rm command in my path that was breaking stuff.

How to fix `brew doctor` errors on Mac OSX 10.9 (unlinked kegs in Cellar and Homebrew sbin not found)?

I'm having some trouble with brew which I'm trying to solve. When I currently run brew doctor I get the following output:
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
autoconf
libevent
Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so
echo export PATH="/usr/local/sbin:$PATH" >> ~/.bash_profile
So I went ahead and tried all the suggestions. First brew link autoconf, which results in:
Linking /usr/local/Cellar/autoconf/2.69... Warning: Could not link autoconf. Unlinking...
Error: Could not symlink file: /usr/local/Cellar/autoconf/2.69/share/emacs/site-lisp/autotest-mode.elc
Target /usr/local/share/emacs/site-lisp/autotest-mode.elc already exists. You may need to delete it.
To force the link and overwrite all other conflicting files, do:
brew link --overwrite formula_name
To list all files that would be deleted:
brew link --overwrite --dry-run formula_name
So again I tried the suggested command: brew link --overwrite autoconf:
Linking /usr/local/Cellar/autoconf/2.69... Warning: Could not link autoconf. Unlinking...
Error: Permission denied - /usr/local/share/emacs/site-lisp/autotest-mode.elc
My initial response to a permission denied is usually prepending it with sudo, which leads brew to tell me: Error: Cowardly refusing tosudo brew link`.
When trying brew link libevent I get the same results as with brew link autoconf.
Finally, I tried solving the sbin that was not found by running the suggested echo export PATH="/usr/local/sbin:$PATH" >> ~/.bash_profile. This runs without error, but when I run brew doctor again, the message still appears.
Does anybody know how I can solve these issues? All tips are welcome!
The general problem here is that autoconf and libevent are already installed on your system, and they are in your homebrew "Cellar" as well. Thus there are TWO copies of autoconf on your system, and TWO copies of libevent on your system.
What homebrew is trying to do is delete the previously install (system wide) version of these libraries, and replace all the relevant REAL files with symlinks from the homebrew Cellar. That would give homebrew full control over upgrading and managing these libraries for you. It would also give you just one copy of these libraries available in two places.
The problem is that homebrew doesn't have unix permissions to delete these REAL files, and you'll need to do it yourself. Here's how for autoconf:
$ sudo rm /usr/local/share/emacs/site-lisp/autotest-mode.elc
$ sudo chmod 777 /usr/local/share/emacs/site-lisp/
$ sudo rm -rf /usr/local/share/autoconf
$ brew link --overwrite autoconf
You should see:
Linking /usr/local/Cellar/autoconf/2.69... 21 symlinks created
UPDATE I just noticed the part about sbin. I'm not sure how this problem happened originally, but I can explain how to fix it.
The fix recommended by homebrew (ECHO ...) only takes effect when you next login to your Mac. To have this change take effect now, you have to force your terminal to re-read the .bash_profile file. Just $ source ~/.bash_profile after you run the ECHO command provided by homebrew.
Since this question is a few months old now, you probably already discovered that this error message has gone away.
Run the following commands to grant the privileges:
$ sudo chown -R $(whoami) /usr/local
Once the privileges are granted, now they have to be just linked since it is already installed:
$ brew link autoconf
$ brew link libevent
You may want to change writing permissions with chmod on /usr/local/share/emacs/site-lisp/autotest-mode.elc
After that you should get something like this:
Linking /usr/local/Cellar/autoconf/2.69... 21 symlinks created

Resources