Homebrew fails when upgrading VIM - vim

When I run brew upgrade on macOS Sierra, the operation fails. The only thing it's trying to upgrade is vim 8.0.0550. I've tried deleting the tar file and forcing a redownload of the upgrade but that hasn't helped. Here is the stacktrace—I can attach more of the log if necessary:
ld: library not found for -lruby.2.4.0
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [vim] Error 1
make: *** [first] Error 2
Edit: Since posting, a thread on this bug has appeared on github. At time of writing, it's still not 100% clear what the problem is.

Try this:
Run brew doctor. This showed the following entry in the text:
+
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:
ruby
To fix run brew link --overwrite ruby
Now proceed to upgrade vim by running brew upgrade vim
I also recommend to fix other reported unlinked kegs.
Hope this helps. It worked pretty well for me.

I came to this question because I was facing the same problem on my Mac OS Sierra.
I have brew and rvm and the brew vim install was failing with the linker error described in the question above. But, I did not want to switch to rbenv as suggested in the comments. I also was not sure about messing with symlinks as I tend to forget and delete the original files that were being linked :-)
The work around I tried was to temporarily switch to the Mac system Ruby install using the command
rvm use system
Then do the brew upgrade of vim and once the install is complete revert back to the ruby that you want to use with rvm.
This worked for me - YMMV

Related

Can't run node or npm, getting the message "zsh: killed" or "Killed: 9" when running on bash

Not sure if related, but over the weekend I upgraded my OS to Big Sur version 11.1 and then when I began working one thing went wrong after another and now I can't use node or npm at all. I get the following message in zsh:
% node -v
zsh: killed node -v
And the following on bash
node -v
Killed: 9
I've tried to install different versions of node through n, which makes no difference.
How it got this way?
Prior to this issue (after my OS upgrade), I couldn't run npm install, and would get the following message:
Maximum call stack size exceeded
This seems to have been reported on this thread, but as of writing this there are no replies.
As the OP on that thread says, I tried installing npm v7, which initially did solve my problem with the npm install, however caused other issues on the project.
I then decided to use n to install the latest version of node and this caused the errors I have above.
Does anyone know what's going on and how to fix it?
Edit: I was forced to uninstall and reinstall node to be able to go back to work, which did solve it but I am leaving this thread up in case there is a better solution.
TLDR:
brew uninstall git
brew update
brew reinstall pcre2 gettext
brew install git
brew reinstall node
I'm sure there's a more surgical solution (e.g., maybe you don't need brew reinstall pcre2 gettext), but this ^^ worked for me. Below is the path I took:
Skimming some google results, seemed it was at least partly due to the new M1 silicon and the minor MacOS update to 11.2.2. Tried to brew update and got:
Error: Failure while executing; `git config --replace-all homebrew.analyticsmessage true` was terminated by uncaught signal KILL.
Which led me to this: https://github.com/Homebrew/brew/issues/10275#issuecomment-757351887. After doing these uninstall, reinstall, installs, I finished with a brew reinstall node and voilà! Didn't need to uninstall node and install from scratch:
an#As-Air ~ % node -v
v15.11.0
TL;DR
The solution is to reinstall node and all its dependencies. Luckily, Homebrew offers a one-liner all-in-one solution:
brew reinstall $(brew deps node) node
Why?
I had followed #albielin and #Mariusz' solutions without success. I didn't yet want the #bgh's nuclear option to reinstall Homebrew with all its packages.
It seems in my case, the issue wasn't coming from those specific dependencies (pcre2 gettext openssl icu4c), but rather another one. No need to worry about git. But do reinstall all dependencies to be sure and avoid an endless trial-and-error with every one of them.
Had the same issue. Tried #albielin approach but it still didn't work for me. Ive took a look in the console and saw issues with openssl and icu4c when executing node --version and reinstalled both. Now it works.
So in addition to #albielin commands I did:
brew reinstall openssl
brew reinstall icu4c
I had the same issue. The answers above didn't work for me. Looking at the console while running node --version I found the error load code signature error 2 for file "node"
Reinstalling Homebrew as detailed in this Stack Overflow answer did it for me:
Run the official uninstall script: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
Clean up: sudo rm -rf /opt/homebrew
Fresh install: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install node: brew install node
The node post-install process ran into a few issues due to symlinks that could not be overwritten. The advice given in this article helped me resolve this; a few sudo chown ... and brew link --overwrite node commands later node was successfully installed!

Reinstall python packages after homebrew python#3.8 update

I have recently updated python to python#3.8 via homebrew.
I then noticed that my python scripts were unable to link to the global python packages that I had previously installed with pip (packages installed globally and not within a virtual environment).
This has sent me down the rabbit hole of understanding how python is set up on macos and I have several questions.
pip installed by homebrew will now install all packages in /usr/local/lib/python3.8/site-packages.
Does that mean I need to reinstall all my python packages that used to live (and still are) in /usr/local/lib/python3.7? Should I remove the latter directory after? (For that matter I can see I have also a /usr/local/lib/python3.6 directory)
What's the efficient way of managing this in the future when the next python update comes along? Virtual envs per project (I'm not very familiar with the use of virtual envs)?
When I run
brew list | grep python I get the following list
python
python3
python#3.8
I can see python#3.8 is correctly symlinked as /usr/local/bin/python3 but I don't know what the python and python3 in the above list are since looking at /usr/local/Cellar I can see that I have an empty /usr/local/Cellar/python directory and a /usr/local/Cellar/python3 directory that is symlinked to it. Can I juste remove these two folders?
Finally, looking into all this, I was surprised to discover a python3 executable living in /usr/bin.
Looking into the sys.path when I execute /usr/bin/python3, I can see it's some sort of python installed by Xcode since it's looking for libraries in various Xcode.app directories.
Since my /usr/local/bin is at the top of my PATH envt variable, this python3 will never be called but I wonder why I'd need it at all and whether I can just get rid of it.
I suppose the answer to a lot of these questions is to use virtual environments, which I've miraculously avoided doing for so long... Would love some help understanding the above though.
EDIT: Running brew info python or brew info python3 returns the same thing
python#3.8: stable 3.8.3 (bottled)
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/python#3.8/3.8.3_2 (4,268 files, 65.5MB) *
Poured from bottle on 2020-07-12 at 23:19:08
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/python#3.8.rb
I had a similar issue with a system running Python 3.9
I had initially not run the final command (only the --dry-run), as everything seemed fine, but as suggested during the installation, using brew link to clobber and create new symlinks was needed.
% brew link --overwrite --dry-run python#3.9
Would remove:
% brew link --overwrite python#3.9
Linking /usr/local/Cellar/python#3.9/3.9.1_1... 23 symlinks created
%
As suggested by MisterMiyagi in the comments, this was uncovered via brew doctor
...
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:
python#3.9

fatal: program autoreconf is required but was not found

I followed the installation of GHCJS and when I came to the step "Build the libraries" and I typed the command ghcjs-boot --dev
But I get the following lines in my Terminal
(lines omitted)...
generating configure script for ./boot/base
MyDir/.ghcjs/x86_64-darwin-0.1.0-7.8.3/ghcjs/ghcjs-boot/boot/base$ [autoreconf]: <not found>
fatal: program autoreconf is required but was not found
name searched for (from boot.yaml or command line): autoreconf
searched in PATH:
MyDir/Haskell/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:MyDir/Haskell/bin
Does anyone know what's wrong here?
Just to make life a bit easier for subsequent users who landed here.
If you have already installed homebrew,
brew install automake will install the autoreconf for you.
Your system is lacking the auto(re)conf tool which is (unfortunately) not installed with XCode any more. There is an old post explaining how to install auto(re)conf on OS X manually:
Install autoreconf on OSX lion?

"spawn.h not found" while installing octopress on Cygwin

I have been trying to install octopress on cygwin. I have googled but no avail. I hope that someone can suggest a hack (no matter how complicated) to resolve this.
I followed the octopress installation instructions. Everything went smoothly till the bundle install stage. When I reached that point, the installation quits with the error telling that it couldn't find spawn.h.
I searched and apparently spawn.h doesn't come in any of the cygwin libraries. I installed all the c++ libraries I could from cygwin setup but that did not help.
Can you please help resolve this?
I think the gem that fails in this process is posix-spawn. For this, you could install the gem locally:
$ gem install rake-compiler -v 0.7.6
$ git clone git://github.com/rtomayko/posix-spawn.git
$ cd posix-spawn
$ rake gem
$ cd pkg/posix-spawn-0.3.6
$ gem install --local posix-spawn-0.3.6.gem
The explanation (from an article I found):
There is a bug in the version of posix-spawn in the gem repositories however that makes installing via gem impossible on Cygwin
After this, try bundle install again, it should be successful.
Here's a related issue on the GitHub project
UPDATE: I recently installed scoop a command-line installer for Windows, a pretty easy setup. I installed Ruby, bundler and octopress without breaking a sweat. You should give it a try.

Yi failed to install

Would love to try the Yi editor, but unfortunately, it keeps failing during the installation.
First I get:
> cabal install yi
haskell-src-exts-1.13.0 failed during the configure step. The exception was:
ExitFailure 1
yi-0.6.5.0 depends on haskell-src-exts-1.13.0 which failed to install.
then when I try to install haskell-src-exts I am stumped by this:
setup: The program happy version >=1.17 is required but it could not be found.
cabal: Error: some packages failed to install:
haskell-src-exts-1.13.0 failed during the configure step. The exception was:
ExitFailure 1
installing happy cabal install happy (version 1.18.9 at that) does not help, as it still produces the error above!
I am trying to get this going on ArchLinux. Also, Windows installation didn't work either.
Any ideas?
cabal installs programs to ~/.cabal/bin (on Unix; no idea about Windows) if they are not already installed, and does not warn you to add it to your $PATH; it also (unless you have the latest unreleased version, built from its repo) does not know that it has done so, because it only tracks libraries, not executables. You will need to manually add $HOME/.cabal/bin to your $PATH so that it will be found
(edit be pedantic)
On ubuntu I installed happy using apt-get instead of through cabal, which worked.
Here is what I have done to install Yi with GTK+ under ArchLinux.
First, I tried cabal install yi and I got the same error as you.
To solve this error, I installed happy using this command:
yaourt -S happy
Then, I got another error because the alex package was needed. So, I installed it with:
yaourt -S alex
After that, I got some errors because of gtk2hs packages missing. I installed them with:
yaourt -S haskell-cairo haskell-glib haskell-gtk haskell-pango
Finally, I was able to install Yi with:
cabal install yi -fvty -fpango
I had the same issue in installing hprotoc which has a dependency on haskell-src-exts. The issue I believe was that I was running the sudo command which was modifying the path. When I took the recommended action in the following Q&A, it resolved the issue of finding happy.
sudo changes PATH - why?
Leksah uses Yi as a component, try installing leksah instead. I had similar error messages at one point, the haskell-src-exts error is due to running out of memory. Reboot your computer, have nothing else running except the console, and try again.

Resources