Tag Archives: brew

[Solved] Mac Install homebrew Error: error: Not a valid ref: refs/remotes/origin/master

The MAC reports the following error after installing homeberw:

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /usr/sbin/chown -R aa:admin /opt/homebrew
==> Downloading and installing Homebrew...
HEAD is now at 8de10a05b Merge pull request #10472 from MikeMcQuaid/new-issue-templates
error: Not a valid ref: refs/remotes/origin/master
fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Error: Fetching /opt/homebrew/Library/Taps/homebrew/homebrew-core failed!
fatal: invalid upstream 'origin/master'
Failed during: /opt/homebrew/bin/brew update --force --quiet

The solution is as follows:

Uninstall homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

Set git compression:

git config --global core.compression 0

Set git buffer size:

git config --global http.postBuffer 1048576000

Reinstall brew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Brew cask installation software prompt: error: unknown command: cask

Brew cask installation software prompt: error: unknown command: cask

problem

➜ /Users/test > brew cask install mounty
Error: Unknown command: cask

Brew cask installation software prompt: error: unknown command: cask

resolvent:

Use brew install -- cask mount

➜ /Users/test >brew install --cask mounty
Updating Homebrew...

Reference address: install software through brew cask on MAC prompt: error: unknown command: cask?

Brew Install python Error: tar: Error opening archive: Failed to open’***‘

Check the reason for the error. At first, I thought it was a permission problem and didn’t write it. After modifying the permission, I found that it still couldn’t be installed.

Check carefully and find that gdbm dependency is not installed.

terms of settlement

To install gdbm dependencies, enter the command line

brew install gdbm

The following indicates that the installation is successful

Finally, execute the command brew install again [email protected]

Installation succeeded!

How to Solve Cocoapods Installation Failure

The scene appears

Recently, I replaced a 512 large hard disk and re installed MacOS 10.15. When installing cocoapods, the following error occurred

Building native extensions. This could take a while...
ERROR:  Error installing cocoapods:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20210324-1667-1wwdce5.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi... yes
checking for ffi_prep_closure_loc() in -lffi... yes
checking for ffi_prep_cif_var()... yes
checking for ffi_raw_call()... yes
checking for ffi_prep_raw_closure()... yes
creating extconf.h
creating Makefile

current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/ext/ffi_c
make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/ext/ffi_c
make "DESTDIR="
make: *** No rule to make target `"/Volumes/macOS', needed by `AbstractMemory.o'.  Stop.

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.0/gem_make.out

Solution:

    1. it may be the problem of system version, which is not compatible with the latest version, so install the old version directly. I encountered the problem is 2021.07.06, the latest version is 1.10.1, find a 1.9.32020.05 release, should be compatible with 10.15
# Specify version to install
sudo gem install -n /usr/local/bin cocoapods -v 1.9.3
      1. use brew to install
brew install cocoapods

[app] install and compile libimobililedevice, How to solve the error

Problem Description:

Error: Failure while executing; `tar --extract --no-same-owner --file /Users/xmly/Library/Caches/Homebrew/downloads/58f1d108442b2cdceb8e86e7d05328381fd0a85b67ae46a66fa710f8f1786b02--libtasn1-4.16.0_1.big_sur.bottle.tar.gz --directory /private/tmp/d20210629-40261-ibafl5` exited with 1. Here's the output:
tar: Error opening archive: Failed to open '/Users/xmly/Library/Caches/Homebrew/downloads/58f1d108442b2cdceb8e86e7d05328381fd0a85b67ae46a66fa710f8f1786b02--libtasn1-4.16.0_1.big_sur.bottle.tar.gz'

Cause of the problem:

Maybe some of the dependent libraries were not downloaded
later, after the installation environment was prepared, they succeeded


* brew install build-essential automake autoconf git cmake pkg-config libtool

install

* Method 1:
	git clone https://github.com/libimobiledevice/libimobiledevice.git
	cd libimobiledevice
	./autogen.sh
	make
	sudo make install

* Method 2:
	brew install --HADE libmobliedevice
	# If you do not add - HADE installation is an older version, does not support IOS 10 or above

[MacOS] brew install 404:Bottle missing, falling back to the default domain…

Contents of articles

Problem description solution

Problem description

MacOS version: 10.15.7 prompts that there is no WGet, so install it through brew. After installing brew, configure the domestic source brew install WGet and report an error

Solution

The homebrew address described in [homebrew boxes source help] is:
0 https://mirrors.ustc.edu.cn/homebrew-bottles/ Run brew config to see

HOMEBREW_BOTTLE_DOMAIN: https://mirrors.ustc.edu.cn/homebrew-bottles

The solution is to change the environment variables and change homebrew_ BOTTLE_ Correct domain

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/bottles' >> ~/.zshrc

source ~/.zshrc

How to Solve brew ERROR in `initialize‘: Version value must be a string; got a NilClass ()

Reason: after MAC is upgraded to MacOS Big Sur system version 11.1, the old version of homebrew is not suitable for the new system, and the message “in ` initialize ‘: version value must be a string” is sent; Got a nilclass() error

Solution:
just update to the latest version of homebrew

$ brew update-reset

Check the version again, OK

$ brew --version
Homebrew 3.1.5-101-gd3013fc

Error: Could not link: /usr/local/share/doc/homebrew

From: http://c.n-di.com/2017/07/17/1827.html
The copyright belongs to the original author!

Error: could not link: / usr / local / etc / Bash_ completion.d/brew

Update brew and report an error;

Error: Could not link:
/usr/local/etc/bash_completion.d/brew

Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/zsh/site-functions/_brew

Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/man/man1/brew.1

Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/doc/homebrew

Please delete these paths and run `brew update`.

terms of settlement

rm -rf /usr/local/etc/bash_completion.d/brew
rm -rf /usr/local/share/zsh/site-functions/_brew
rm -rf /usr/local/share/man/man1/brew.1
rm -rf /usr/local/share/doc/homebrew
brew update

Install and run phantomjs on MAC

Maybe it’s too easy?There are no tramp tutorials on Search.com.

Search phantomjs on your MAC and get the following method:

Download Phantomjs.zip and unzip. Bin/Phantomjs is directly available.

Or it can be installed through Homebrew

brew update & & brew install phantomjs

Or install via MacPorts

sudo port selfupdate & & sudo port install phantomjs

These are the three ways to do it, and they all make a dent.

Let’s start with the method that will ultimately make my installation a success: using Homebrew.

What is Homebrew?

The Missing Package Manager for OS X (The indispensable Package Manager for OS X)

Installation:

It is very simple to execute the command line directly from the MAC terminal

The/usr/bin/ruby – e “$(curl – fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

Testing:

Enter BREW – V to see the version number, indicating a successful installation.

Install phantomjs:

Type BREW Update (I didn’t enter it, the next install will automatically help me update.)

Wait until the update is complete before typing
Brew Install Phantomjs. Installed successfully! Enter the PhantomJs-V view number to confirm.

A simple hello. Js:

console.log(“Hello,world!” );

phantom.exit();

Run:

The directory where the JS file is running on the CD

Phantomjs hello. Js

Output Hello, world!

Error in brew install: curl: (22) the requested URL returned error: 404 Not Found

When installing ZooKeeper today, I reported the following error

brew install zookeeper

Updating Homebrew...
==> Downloading https://mirrors.aliyun.com/homebrew/homebrew-bottles/bottles/zookeeper-3.4.13.mojave.bottle.tar.gz
######################################################################## 100.0
curl: (22) The requested URL returned error: 416
Error: Failed to download resource "zookeeper"
curl: (22) The requested URL returned error: 404 Not Found
Trying a mirror...
==> Downloading https://www-eu.apache.org/dist/zookeeper/zookeeper-3.4.13/zookeeper-3.4.13.tar.gz

curl: (22) The requested URL returned error: 404 Not Found
Error: An exception occurred within a child process:
  DownloadError: Failed to download resource "zookeeper"
Download failed: https://www-us.apache.org/dist/zookeeper/zookeeper-3.4.13/zookeeper-3.4.13.tar.gz

When I saw the error, I checked out zookeeper’s official website

I found that the official website had been updated to version 3.4.14, but BREW still downloaded version 3.4.13, so the above problems would be caused. I found that by looking up information online, I could operate this way and directly use the download address of the official website

brew install https://www-us.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz

It has been proved that this method does not work
You need to update Git

brew install git

then

brew install zookeeper

done

brew link sip error

Problems with BREW installing SIP:

$ brew install sip
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink include/sip.h
/usr/local/include is not writable.

You can try again using:
  brew link sip

$ brew link sip
Linking /usr/local/Cellar/sip/4.19.5... 
Error: Could not symlink include/sip.h
/usr/local/include is not writable.

Find /usr/local/ there is no path /usr/local/include
need to create this path and modify the permissions
Solution:

$ sudo mkdir /usr/local/include
$ sudo chown $(whoami):admin /usr/local/include

Success:

$ brew link sip
Linking /usr/local/Cellar/sip/4.19.5... 10 symlinks created