Comments (4)
Thanks for the report! Sorry, I was away for the weekend. I just fixed the first issue (error message; 0a6cff1) as well as the second (doesn’t work; 5d0556b). Just run brew update
to get the fixes.
As far as I understand, Homebrew is increasingly moving from code where constants and classes are explicitely required rather than being globally available. This is a good thing, but it breaks code that rely on that global availability, like here.
from homebrew-command-not-found.
@andrewcrook I was coming to open this very same issue. 😁
I fixed this issue by updating my configuration for bash
.
What I had:
# Homebrew - Command Not Found - Reproduces Ubuntu’s command-not-found for Homebrew users on macOS.
# https://github.com/Homebrew/homebrew-command-not-found
if brew command command-not-found-init > /dev/null; then
eval "$(brew command-not-found-init)"
What I changed it to:
# Homebrew - Command Not Found - Reproduces Ubuntu’s command-not-found for Homebrew users on macOS.
# https://github.com/Homebrew/homebrew-command-not-found#install
HB_CNF_HANDLER="$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh"
if [ -f "$HB_CNF_HANDLER" ]; then
source "$HB_CNF_HANDLER";
fi
👉 That got rid of the error at shell startup, but now it just tool doesn't work at all...
$ when
when: command not found
from homebrew-command-not-found.
@peterlobster
Yes, I believe both should work.
I use the first example in my.zshrc
command-not-found should add commands to extend brew so that you can initialise it via brew command.
I am busy at the moment,however,if I find anything I will post here. I am sure it's something to do with the brew-core update.
from homebrew-command-not-found.
I was going to open an issue for the same.
Same here. Exact error as seen by @andrewcrook.
I changed exactly what @peterlobster did, and same results.
from homebrew-command-not-found.
Related Issues (20)
- Takes 1-2 seconds before it shows the message HOT 10
- Commands starting with '-' can appear to be options and need quoting HOT 1
- Using brew gives warnings HOT 18
- Command brew which-update fails HOT 2
- Consider supporting fish. HOT 1
- (eval):1: no matches found: “# HOT 11
- Incorrectly refer to .bashrc as opposed to .bash_profile? HOT 3
- not working and I've installed and edited my bash_profile HOT 6
- I followed the installation instructions but it doesn't work HOT 2
- Error: undefined method `install_tap' for Homebrew:Module HOT 3
- could this be extended to support searching libraries? (not just binaries) HOT 2
- `brew which-formula lldb` empty for formulas requiring options (eg lldb) HOT 2
- duplicate 'zsh: command not found: ' HOT 1
- Error with brew which-update: undefined method `split' for nil:NilClass HOT 2
- Redundancy in installation instructions around `brew command-not-found-init` HOT 5
- command-not-found causes VERY long zsh startup times HOT 10
- `brew which-formula` doesn't work HOT 2
- Path given in README does not work for `/opt/homebrew` installations on M1 Macs
- prompt if not in PATH? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebrew-command-not-found.