Homebrew on El Capitan - Not able to run "brew doctor" - homebrew

I'm trying to install Ruby and Rails, and I'm not able to get the installation to run. When I run RVM I get:
Error running 'requirements_osx_brew_libs_install autoconf automake libtool pkg-config libyaml readline libksba openssl',
showing last 15 lines of /Users/Aman/.rvm/log/1448680507_ruby-2.2.1/package_install_autoconf_automake_libtool_pkg-config_libyaml_readline_libksba_openssl.log
++ case "$1" in
++ [[ -t 1 ]]
++ return 1
++ printf %b 'There were package installation errors, make sure to read the log.
Try `brew tap --repair` and make sure `brew doctor` looks reasonable.
Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation\n'
There were package installation errors, make sure to read the log.
Try `brew tap --repair` and make sure `brew doctor` looks reasonable.
Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation
++ case "$_system_version" in
++ return 1
Requirements installation failed with status: 1.
and When I run 'brew doctor' I get
'Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool'

Related

Install Ruby 2.0.0 on an old Mac OS 10.7.5 Lion

I have tried to upgrade the Ruby version on an old Mac I got, but without any success.
I know its possible because of this guy here asking how to upgrade from 2.2
Here is what I entered in the Terminal:
rvm install 2.0.0
Result:
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.7/x86_64/ruby-2.0.0-p648.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Installing requirements for osx.
Updating system................
Installing required packages: coreutils.....There were package installation errors, make sure to read the log.
Try `brew tap --repair` and make sure `brew doctor` looks reasonable.
Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation
...
Error running 'requirements_osx_brew_libs_install coreutils',
please read /Users/DAN26/.rvm/log/1503823469_ruby-2.0.0-p648/package_install_coreutils.log
Requirements installation failed with status: 1.
Seems like "coreutils" is missing so I manage to install it by my self, however without success:
brew install coreutils
==> Downloading https://ftp.gnu.org/gnu/coreutils/coreutils-8.27.tar.xz
Already downloaded: /Users/DAN26/Library/Caches/Homebrew/coreutils-8.27.tar.xz
==> Downloading https://raw.githubusercontent.com/macports/macports-ports/61f1b0d/sysutils/coreutils/f
Already downloaded: /Users/DAN26/Library/Caches/Homebrew/coreutils--patch-df9bedeae2ca6d335147b5b4c3f19db2f36ff8c84973fd15fe1697de70538247.diff
==> Downloading https://raw.githubusercontent.com/macports/macports-ports/61f1b0d/sysutils/coreutils/f
Already downloaded: /Users/DAN26/Library/Caches/Homebrew/coreutils--patch-f7e2b21f04085f589c3d10c2f6ac5a4185e2b907e8bdb5bb6e4f93888d7ab546.diff
==> Patching
==> Applying patch-m4_gnulib-comp.m4-add-renameat.diff
patching file m4/gnulib-comp.m4
==> Applying patch-lib_gnulib.mk-add-renameat.c.diff
patching file lib/gnulib.mk
==> Downloading https://raw.githubusercontent.com/macports/macports-ports/61f1b0d/sysutils/coreutils/f
Already downloaded: /Users/DAN26/Library/Caches/Homebrew/coreutils--renameat_c-8.27.c
==> Downloading https://raw.githubusercontent.com/macports/macports-ports/61f1b0d/sysutils/coreutils/f
Already downloaded: /Users/DAN26/Library/Caches/Homebrew/coreutils--renameat_m4-8.27.m4
==> autoreconf -fiv
==> ./configure --prefix=/usr/local/Cellar/coreutils/8.27 --program-prefix=g --without-gmp
==> make install
Last 15 lines from /Users/DAN26/Library/Logs/Homebrew/coreutils/03.make:
src/ginstall -c src/truncate '/usr/local/Cellar/coreutils/8.27/bin/./gtruncate'
src/ginstall -c src/tsort '/usr/local/Cellar/coreutils/8.27/bin/./gtsort'
src/ginstall -c src/tty '/usr/local/Cellar/coreutils/8.27/bin/./gtty'
src/ginstall -c src/uname '/usr/local/Cellar/coreutils/8.27/bin/./guname'
src/ginstall -c src/unexpand '/usr/local/Cellar/coreutils/8.27/bin/./gunexpand'
src/ginstall -c src/uniq '/usr/local/Cellar/coreutils/8.27/bin/./guniq'
src/ginstall -c src/unlink '/usr/local/Cellar/coreutils/8.27/bin/./gunlink'
src/ginstall -c src/vdir '/usr/local/Cellar/coreutils/8.27/bin/./gvdir'
src/ginstall -c src/wc '/usr/local/Cellar/coreutils/8.27/bin/./gwc'
src/ginstall -c src/whoami '/usr/local/Cellar/coreutils/8.27/bin/./gwhoami'
src/ginstall -c src/yes '/usr/local/Cellar/coreutils/8.27/bin/./gyes'
src/ginstall -c src/ginstall '/usr/local/Cellar/coreutils/8.27/bin'
make[2]: *** [install-am] Error 2
make[1]: *** [install-recursive] Error 1
make: *** [install] Error 2
Do not report this issue to Homebrew/brew or Homebrew/core!
Error: You are using macOS 10.7.
We (and Apple) do not provide support for this old version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
Also I have tried to follow the steps for installing coreutils from source by this comment
wget https://ftpmirror.gnu.org/coreutils/coreutils-8.25.tar.xz
tar xJf coreutils-8.25.tar.xz
cd coreutils-8.25/
./configure --prefix=/usr/local
make
sudo make install
But after that retry to install Ruby 2.0.0 fail again for the same reason.
Can someone please help me to solve this problem?
Homebrew doesn’t support macOS 10.7. You can use Tigerbrew, a fork of Homebrew "that adds support for PowerPC Macs, and Macs running Tiger or Leopard" (quoting its homepage).

Ruby 'rails server' issue

Been getting an error everytime I try to run 'rails server'
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
Don't forget to include the above Crash Report log file.
For details: http://www.ruby-lang.org/bugreport.html
Abort trap: 6
I have tried following the other tips such as bundle install and update but still same problem. Tried to rvm install 1.9.3 and got:
Checking requirements for osx.
Installing requirements for osx.
Updating system.....
Installing required packages: gcc49.......
Error running 'requirements_osx_brew_libs_install gcc49',
showing last 15 lines of /Users/Quoc/.rvm/log/1457707600_ruby-1.9.3-p551/package_install_gcc49.log
++ case "$1" in
++ [[ -t 1 ]]
++ return 1
++ printf %b 'There were package installation errors, make sure to read the log.
Try `brew tap --repair` and make sure `brew doctor` looks reasonable.
Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation\n'
There were package installation errors, make sure to read the log.
Try `brew tap --repair` and make sure `brew doctor` looks reasonable.
Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation
++ case "$_system_version" in
++ return 1
Requirements installation failed with status: 1.
Brew repair didnt work either.
EDIT: result from running brew install gcc46 --env=std
==> make bootstrap
Last 15 lines from /Users/Quoc/Library/Logs/Homebrew/gcc46/02.make:
_lto_end_uncompression in libbackend.a(lto-compress.o)
"_inflateEnd", referenced from:
_lto_end_uncompression in libbackend.a(lto-compress.o)
"_inflateInit_", referenced from:
_lto_end_uncompression in libbackend.a(lto-compress.o)
"_zError", referenced from:
_lto_end_compression in libbackend.a(lto-compress.o)
_lto_end_uncompression in libbackend.a(lto-compress.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [cc1] Error 1
rm gcc.pod
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [bootstrap] Error 2
You have to install these dependences manually, try
brew install automake
if it gives you error of missing link of automake something like this
You must brew link autoconf before automake can be installed
then try these commands
brew link --overwrite --dry-run autoconf
brew link --overwrite autoconf
brew install automake
it will install automake and then you can try again to install ruby.
If it doesn't work you can try another thing:
Sol2:
brew install gcc46 --env=std
brew install gcc; brew install gcc46 --cc=gcc-4.9
Manually build GCC 4.6 outside of Homebrew, using the same configure switches
Also you can try with this :
$ brew install gcc
$ CC=/usr/local/bin/gcc-4.9 rvm install 1.9.1-p376 --enable-shared

Can't re-install homebrew

I'm having a problem re-installing homebrew. I am running Mavericks
It started with me trying to install express.js. Homebrew had been installed on my mac for quite some time, never had any trouble with it. I used sudo npm install -g express, but when I ran express --version, I got command not found. Eventually, I found a possible solution online, and just tried to reinstall npm with brew remove npm and brew install npm. Again, I ran into errors (Unfortunately, I didn't save the exact errors) I used brew doctor to try and figure it out, looked up a ton of tutorials and mucked around with homebrew, and I guess I broke something.
Now, I figure I should just try and reinstall homebrew.
I run the install command for homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It returns this message:
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
So, I run
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
This returns:
-bash: brew: command not found
I try running the install command again, and this time, it doesn't tell me homebrew is already installed.
So again, I run the install command for homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
And now I get this:
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
Password:
==> Downloading and installing Homebrew...
remote: Counting objects: 136, done.
remote: Total 136 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (136/136), 10.37 MiB | 1.53 MiB/s, done.
Resolving deltas: 100% (44/44), done.
From https://github.com/Onomanatee/portfolio_Yuri_Legiest
* [new branch] master -> origin/master
HEAD is now at c253261 Commit4
==> Installation successful!
==> Next steps
Run brew doctor before you install anything
Run brew help to get started
Running brew doctor or brew help , however, results in
-bash: brew: command not found
I really don't know how to fix this. And why is the brew installer referring to a repository I used as a test for a little web project? (right above Installation succesful!)

Error with "rvm requirements"

When I try to run "rvm requirements" it fails, giving me following error:
Checking requirements for osx.
Installing requirements for osx.
Updating system....
Installing required packages: libksba.....
Error running 'requirements_osx_brew_libs_install libksba',
showing last 15 lines of /Users/Hany/.rvm/log/1398501597/package_install_libksba.log
+ case "$1" in
+ [[ -t 1 ]]
+ return 1
+ printf %b 'There were package installation errors, make sure to read the log.
Try `brew tap --repair` and make sure `brew doctor` looks reasonable.
Check Homebrew requirements https://github.com/mxcl/homebrew/wiki/Installation\n'
There were package installation errors, make sure to read the log.
Try `brew tap --repair` and make sure `brew doctor` looks reasonable.
Check Homebrew requirements https://github.com/mxcl/homebrew/wiki/Installation
+ case "$_system_version" in
+ return 1
Requirements installation failed with status: 1.
I thought I would use homebrew to install individually. So I ran "brew install libksba"
==> Downloading ftp://ftp.gnupg.org/gcrypt/libksba/libksba-1.3.0.tar.bz2
Already downloaded: /Library/Caches/Homebrew/libksba-1.3.0.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/libksba/1.3.0
==> make install
make[2]: *** [reader.lo] Error 1
1 error generated.
make[2]: *** [asn1-parse.lo] Error 1
make[1]: *** [install] Error 2
make: *** [install-recursive] Error 1
READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting
But this failed, saying it was already installed. Very confused here. Any help?

How to tell if homebrew is installed on Mac OS X

I am doing some Rails programming and I consistently see Homebrew referenced in solutions around the web but have never used it.
I also notice Homebrew in the terminal version 2.9 as an option next to "Shell -> New" from the terminal drop down but when I select homebrew and issue commands, they fail.
Usually with the "command not found" error.
Strangely enough I have been unable to locate a simple command to determine whether brew is installed or not.
How do I check to see if Homebrew is already installed on my Mac?
brew help. If brew is there, you get output. If not, you get 'command not found'. If you need to check in a script, you can work out how to redirect output and check $?.
I use this to perform update or install:
which -s brew
if [[ $? != 0 ]] ; then
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
brew update
fi
The standard way of figuring out if something is installed is to use which.
If Brew is installed.
>>> which brew
/usr/local/bin/brew
If Brew is not installed.
>>> which brew
brew not found
Note: The "not installed" message depends on your shell. zsh is shown above. bash will just not print anything. csh will say brew: Command not found. In the "installed" case, all shells will print the path.)
It works with all command line programs. Try which grep or which python. Since it tells you the program that you're running, it's helpful when debugging as well.
While which is the most common way of checking if a program is installed, it will tell you a program is installed ONLY if it's in the $PATH. So if your program is installed, but the $PATH wasn't updated for whatever reason*, which will tell you the program isn't installed.
(*One example scenario is changing from Bash to Zshell and ~/.zshrc not having the old $PATH from ~/.bash_profile)
command -v foo is a better alternative to which foo. command -v brew will output nothing if Homebrew is not installed
command -v brew
Here's a sample script to check if Homebrew is installed, install it if it isn't, update if it is.
if [[ $(command -v brew) == "" ]]; then
echo "Installing Hombrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
echo "Updating Homebrew"
brew update
fi
brew -v or brew --version does the trick!
I just type brew -v in terminal if you have it it will respond with the version number installed.
Location of the brew where it installed
which brew
version of home brew install
brew --version
[ ! -f "`which brew`" ] && echo "not installed"
Explaination: If brew is not installed run command after &&
brew doctor checks if Homebrew is installed and working properly.
use either the which or type built-in tools.
i.e.: which brew or type brew
Maybe your mac don't received the path
enter image description here
Run command below
eval "$(/opt/homebrew/bin/brew shellenv)"
And run to check that work
brew help
Beginners normally do, the homebrew --version which is wrong.
Do instead, brew --version. brew help works also. If these two commands are not executed, you don't have homebrew installed.
Another one possible way:
# Check if Ninja is installed
if ! which ninja > /dev/null
then
echo 'Ninja installation...'
brew install ninja
fi
In my case Mac OS High Sierra 10.13.6
brew -v
OutPut-
Homebrew 2.2.2
Homebrew/homebrew-core (git revision 71aa; last commit 2020-01-07)
Homebrew/homebrew-cask (git revision 84f00; last commit 2020-01-07)
Yes you can run which brew, but you may have it installed and it says it is not found if you are using zsh. You will need to add it to your .zshrc file.
I find it simple to use brew help command to find it is installed or not. There was a user guide on the homebrew download page.
If it is not installed then it will show 'command not found'
If you need to install homebrew then paste this on terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
jest write brew -v in terminal and if you have it , you will see there version number and the install date .
like this :
Homebrew 3.3.12
Homebrew/homebrew-core (git revision c3cacc9cd1d; last commit 2022-01-31)
Homebrew/homebrew-cask (git revision fb6ec06d8b; last commit 2022-01-31)
Once you install Homebrew, type command brew doctor in terminal.
If you get the following message:
Your system is ready to brew
then you are good to go and you have successfully installed homebrew.
If you get any warnings, you can try fixing it.
Another way to do it is using the "command" builtin tool
if [ "$(command -v brew)" ]; then
echo "command \"brew\" exists on system"
fi
in your terminal, do which brew and itll tell you where it was installed at within your computer, but itll only work in zsh not in bash.
Running Catalina 10.15.4 I ran the permissions command below to get brew to install
sudo chown -R $(whoami):admin /usr/local/* && sudo chmod -R g+rwx /usr/local/*

Resources