brew install libyaml ERROR - installation

$ brew install libyaml
==> Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
Already downloaded: /Library/Caches/Homebrew/libyaml-0.1.4.tar.gz
==> ./configure --prefix=/usr/local/Cellar/libyaml/0.1.4
==> make install
Warning: Could not link libyaml. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link libyaml'
==> Summary
🍺 /usr/local/Cellar/libyaml/0.1.4: 7 files, 336K, built in 9 seconds
OS X 10.8.2
how do I fix this problem?
what should I do ?

Start with brew doctor which will show you errors with your brew setup.
You might see something like this: "Warning: /usr/local/lib/pkgconfig isn't writable."
It will give you the advice that: "You should probably chown /usr/local/lib/pkgconfig".
This means: sudo chown {your-user-name} /usr/local/lib/pkgconfig
Then you will need to link the files with this: brew link libyaml
If this does not work hopefully the output of brew doctor will give you enough to continue the search.

Related

Why can't I install openssl on my Mac by homebrew?

I run the following code, which show that there are no openssl repo find in brew.
My Mac is macOS Big Sur 11.3.1
% brew install openssl
Updating Homebrew...
fatal: Could not resolve HEAD to a revision
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
==> Updated Casks
Updated 1 cask.
Warning: No available formula or cask with the name "openssl".
==> 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...
This formula was found in a tap:
homebrew/portable-ruby/portable-openssl
To install it, run:
brew install homebrew/portable-ruby/portable-openssl
UPDATE
Seems that my brew can't install ccache either like the following. It is more of a brew issue?
brew install ccache
try this put it in terminal and run:
brew uninstall openssl; brew uninstall openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
The following commands help
cd /usr/local/Homebrew/Library/Taps/homebrew/
rm -rf homebrew-core
git clone https://github.com/Homebrew/homebrew-core.git
try this:
git -C $(brew --repo homebrew/core) checkout master
^This should be the fix anytime you see the error "Could not resolve HEAD to a revision, as you may find at the bottom of the output when running "brew doctor"

Can't install emacs in Homebrew

$ brew install emacs
Updating Homebrew...
Warning: Treating emacs as a formula. For the cask, use homebrew/cask/emacs
==> Downloading https://homebrew.bintray.com/bottles/emacs-27.1.mojave.bottle.1.tar.gz
Already downloaded: /Users/xxx/Library/Caches/Homebrew/downloads/edc19e2cbf4d5136f0e31adfb9c57161b65dd8163f861a92e10bfd617d1d611c--emacs-27.1.mojave.bottle.1.tar.gz
==> Pouring emacs-27.1.mojave.bottle.1.tar.gz
==> emacs cask is installed, skipping link.
==> Caveats
To have launchd start emacs now and restart at login:
brew services start emacs
Or, if you don't want/need a background service you can just run:
emacs
==> Summary
🍺 /usr/local/Cellar/emacs/27.1: 4,009 files, 104.0MB
==> Upgrading 1 dependent:
cask 0.8.4 -> 0.8.5
==> Upgrading cask 0.8.4 -> 0.8.5
==> Downloading https://github.com/cask/cask/archive/v0.8.5.tar.gz
==> Downloading from https://codeload.github.com/cask/cask/tar.gz/v0.8.5
######################################################################## 100.0%
Error: An exception occurred within a child process:
RuntimeError: /usr/local/opt/emacs not present or broken
Please reinstall emacs. Sorry :(
How to fix this?
By looking at the output, it seems emacs actually got installed:
==> Summary
🍺 /usr/local/Cellar/emacs/27.1: 4,009 files, 104.0MB
You should be able to use it straight away.
If you prefer a GUI version, you can install it with:
brew install --cask emacs
The problem
Error: An exception occurred within a child process:
RuntimeError: /usr/local/opt/emacs not present or broken
Please reinstall emacs. Sorry :(
It's another tool, cask, which fails to install:
It cannot find the emacs dir under /usr/local/opt/emacs.
Homebrew installed it at /usr/local/Cellar/emacs/27.1.
The fix
You can fix it by:
(Recommended) Creating a symlink in /usr/local/opt/ to emacs directory
$ brew link --overwrite emacs # if it complains about relinking, run brew unlink emacs && brew link emacs instead
$ brew install cask
(Alternative) If the previous point didn't help, ignoring dependencies while installing cask
$ brew install cask --ignore-dependencies
Please let me know if it helped

brew cannot find ANY packages

I just got my Mac Pro from the shop after hard drive failure. I am trying to install my environment again.
I installed homebrew from the current link on the homebrew website:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
but I cannot install ANY package. Brew cannot find ANYTHING.
~ brew install rbenv
Error: No available formula with the name "rbenv"
==> 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.
What is wrong?
I had the same issue and I was able to solve it by running the doctor command and follow the steps which need to be updated there.
My homebrew-core was not at the master branch.
brew doctor
git -C $(brew --repo homebrew/core) checkout master
And that's it. After that, I was able to run the rbenv install command.
brew search result
$ brew search rbenv
==> Formulae
rbenv rbenv-bundle-exec rbenv-chefdk rbenv-default-gems rbenv-vars
rbenv-aliases rbenv-bundler rbenv-communal-gems rbenv-gemset rbenv-whatis
rbenv-binstubs rbenv-bundler-ruby-version rbenv-ctags rbenv-use
install rbenv
$ brew install rbenv
==> Downloading https://github.com/rbenv/ruby-build/archive/v20200819.tar.gz
==> Downloading from https://codeload.github.com/rbenv/ruby-build/tar.gz/v20200819
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/rbenv-1.1.2.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Installing dependencies for rbenv: ruby-build
==> Installing rbenv dependency: ruby-build
==> ./install.sh
==> Caveats
ruby-build installs a non-Homebrew OpenSSL for each Ruby version installed and these are never upgraded.
To link Rubies to Homebrew's OpenSSL 1.1 (which is upgraded) add the following
to your /Users/rchen/.bash_profile:
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl#1.1)"
Note: this may interfere with building old versions of Ruby (e.g <2.4) that use
OpenSSL <1.1.
==> Summary
🍺 /usr/local/Cellar/ruby-build/20200819: 509 files, 253.6KB, built in 5 seconds
==> Installing rbenv
==> Pouring rbenv-1.1.2.mojave.bottle.tar.gz
🍺 /usr/local/Cellar/rbenv/1.1.2: 36 files, 65KB
==> Caveats
==> ruby-build
ruby-build installs a non-Homebrew OpenSSL for each Ruby version installed and these are never upgraded.
To link Rubies to Homebrew's OpenSSL 1.1 (which is upgraded) add the following
to your /Users/rchen/.bash_profile:
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl#1.1)"
Note: this may interfere with building old versions of Ruby (e.g <2.4) that use
OpenSSL <1.1.
version test
$ rbenv --version
rbenv 1.1.2

Tried installing MongoDB with brew and it says "Error: Permission denied - (mongod.conf, /usr/local/etc/mongod.conf)"

Using Mac OSX 10.10.4 on 13' Macbook Air
Typed in 'brew update' like the Mongo docs said and it updated
Then typed 'brew install mongodb' and it took ages to say
Error: Permission denied - (mongod.conf, /usr/local/etc/mongod.conf)
This is what the console said leading up to that point, in case this helps:
Joshuas-Air:~ Josh$ brew install mongodb
==> Downloading https://homebrew.bintray.com/bottles/mongodb-3.0.4.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mongodb-3.0.4.yosemite.bottle.tar.gz
Error: Permission denied - /usr/local/etc/mongod.conf
Warning: Bottle installation failed: building from source.
==> Installing mongodb dependency: scons
==> Downloading https://homebrew.bintray.com/bottles/scons-2.3.5.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring scons-2.3.5.yosemite.bottle.tar.gz
🍺 /usr/local/Cellar/scons/2.3.5: 208 files, 2.4M
==> Downloading https://fastdl.mongodb.org/src/mongodb-src-r3.0.4.tar.gz
######################################################################## 100.0%
==> Cloning https://github.com/mongodb/mongo-tools.git
Updating /Library/Caches/Homebrew/mongodb--github.com-mongodb-mongo-tools--git
==> Checking out tag r3.0.4
==> ./build.sh
==> /usr/local/opt/scons/bin/scons install --prefix=/usr/local/Cellar/mongodb/3.0.4 -j4 --osx-version-min=10.10 --cc=/usr/bin/clang --cxx=/usr/bin/clang++ --use-new-tools
Error: Permission denied - (mongod.conf, /usr/local/etc/mongod.conf)
Joshuas-Air:~ Josh$
Any help at all would be appreciated.
I had mostly the same error. I could not solve the problem by chown'ing the /usr/local directories as the prompts suggest possibly due to my upgrade to High Sierra. I was able to succeed installing mongodb by reinstalling homebrew using the following command:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
This allowed my subsequent brew install mongodb to work.
I had the same problem, changing the directory permissions didn't work for me so eventually I've found this solution:
Download the most recent version (.tgz).
Open the terminal and head to the ~/Downloads folder or wherever you saved the file.
Untar: tar xvf filename.tgz.
Enter the directory and go to the bin directory.
At the terminal use the sudo bash (become root) command.
Now enter the command cp * /usr/local/bin.
Create /data/db directories (optional, this is the default location MongoDB uses).
At the terminal use the command exit to exit root user.
which mongo should now respond with /usr/local/bin and you are all set to go.
My guess is that the permissions on the folder /usr/local/ are not set 755 or 777.
You can change the permissions or simply try to run the command as root:
sudo brew install mongodb

Can't install imagemagick and rmagick on OSX Mavericks

I'm having problems to install imagemacgick and rmagick
➜ scripts brew install imagemagick
Error: You must `brew link freetype' before imagemagick can be installed
➜ scripts brew install freetype
Warning: freetype-2.5.3_1 already installed
➜ scripts brew unlink freetype && brew link freetype
Unlinking /usr/local/Cellar/freetype/2.5.3_1... 1 symlinks removed
Linking /usr/local/Cellar/freetype/2.5.3_1... Error: No such file or directory - /usr/local/Cellar/freetype/2.5.3/include/freetype2
brew remove freetype && brew install freetype
Uninstalling /usr/local/Cellar/freetype/2.5.3_1...
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/freetype-2.5.3
Already downloaded: /Library/Caches/Homebrew/freetype-2.5.3_1.mavericks.bottle.1.tar.gz
==> Pouring freetype-2.5.3_1.mavericks.bottle.1.tar.gz
Error: An unexpected error occurred during the brew link step
The formula built, but is not symlinked into /usr/local
No such file or directory - /usr/local/Cellar/freetype/2.5.3/include/freetype2
Error: No such file or directory - /usr/local/Cellar/freetype/2.5.3/include/freetype2
There is some problem with freetype
I've found a solution here:
brew uninstall freetype
brew install https://raw.github.com/mxcl/homebrew/04406ae9a0aa093aaaf61ab06dc1d81672c41fee/Library/Formula/freetype.rb
brew install freetype
brew install imagemagick
It worked for me
Update:
It seems it's not recommended to checkout the repository directly and you can install by using a link with the revision hash
I've updated my answer accordingly
Also, please note that i've used a more recent hash than the one in the link, otherwise imagemagick will complain about the version of libfreetype.6.dylib

Resources