I am newbie to OSX, I tried to install bash, but when I running the terminal I got this error msg: -bash: /usr/local/Cellar/grc/1.5/etc/grc.bashrc: No such file or directory
so how I can fix it?
Reading the output of brew info grc
grc: stable 1.5
http://korpus.juls.savba.sk/~garabik/software/grc.html
Conflicts with: cc65
Not installed
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/grc.rb
==> Caveats
New shell sessions will start using GRC after you add this to your profile:
source "`brew --prefix`/etc/grc.bashrc"
suggests you look for and remove from your .bash_profile file a line similar to the last line in the output above.
I had the same issue where the shell (in my case zsh) had an error upon starting, which for me appeared after upgrading OS X.
The problem is that the brew command is called before the shell knows where the brew command is stored. To fix it, in your .bash_profile (or .zshrc) move this line:
source "`brew --prefix`/etc/grc.bashrc"
to be after this line:
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
Related
I have previously installed npm, homebrew, oh-my-zsh and other runtime environments and worked perfectly on my Mac M1, until recently, no packages or runtime environments are being recognised.
When I enter brew I get error as zsh: command not found: brew but I can see in my opt/ path that there's homebrew folder and its content present,
Similarly for npm it shows error zsh: command not found: npm
I might have done something with my PATH
Here's a screenshot
Edit: My .bash_profile is empty, should it be empty??
On the M1 Macs, homebrew files are installed by default in /opt/homebrew, and the executables are usually placed in or linked to /opt/homebrew/bin. That directory is not in your search PATH - instead, it looks like you have the PATH settings for an Intel Mac.
As you noted, updating the PATH should fix the issue, but first you need to determine which shell you are using (the question is tagged both zsh and bash). It's probably zsh, since that's the default on newer versions of macOS, and it would explain why the .bash_profile is empty. You can double-check this with the command echo $0.
There are several ways to update the path, and many are described in other posts here at SO, such as this one. This will also work for zsh:
print 'PATH=$PATH:/opt/homebrew/bin' >> ~/.zshrc
I have an M1 Mac Mini. Every time I want to use brew in a new terminal, it tells me :
zsh: command not found: brew
So I always do this to solve it :
export PATH=$PATH:/opt/homebrew/bin
But then the next time I open a terminal, this has been forgotten. Is there a way to make it stick? I wonder why the homebrew installation doesn't do this by default? (It does warn me that it's not added to the path during installation).
Thanks!
Create/open the ~/.zshrc file and add this line to it: export PATH=$PATH:/opt/homebrew/bin
I am having a problem about linuxbrew.
bash: /lustre7/home/lustre4/user1/applications/bin/cut: /lustre7/home/lustre4/user1/.linuxbrew/lib/ld.so: bad ELF interpreter: No such file or directory
I tried to uninstall linuxbrew using instructions at its website, but somehow it didn't work (because of sudo requirements).
there is linuxbrew directory but I can't remove when I type rm -r linuxbrew it says;
-bash: /lustre7/home/lustre4/user1/applications/bin/rm: /lustre7/home/lustre4/user1/.linuxbrew/lib/ld.so: bad ELF interpreter: No such file or directory
When I tried to install homebrew it says your CPU is not supported. (I tried this before and it worked, but now it is not working.)
I want to solve this problem but I couldn't find any solution. I am not able to run sudo and yum commands because I am not root. I am a user at a linux cluster.
OK. I finally was able to solve this issue.
I am wring in case someone else may have the same issue.
First, this was related to a bash problem. I recently installed a tool that put some variables to both bashrc and bash_profile and altered path of bin directory.
I wasn't able to use system commands such as rm, ls, cat etc. and I wasn't able to run system ruby. Paths of all commands and ruby were in my bin directory under my application directory.
What I did is;
I edited my bash_profile by cancelling the new path that caused conflict between bash_profile and bashrc. This enabled me run system commands.
I uninstalled linuxbrew as described in its website.
I removed linuxbrew from my home directory, and cancelled its path in bash_profile (comment out).
I installed homebrew again and put its path to my bashrc.
Now it is working.
I could uninstall linuxbrew using the procedure I described in here:
How to completely uninstall brew and re-install brew in ubuntu 19.04
-> In short, I just replaced install.sh by uninstall.sh and it worked...
$/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
Yesterday I was using all my installed packages without any problem such as mysql, composer, php, brew and co...
However, today I started my MacBook and typed mysql and I got: zsh: command not found: mysql. Not even brew is working anymore and I don't know why.. this is my .zshrc config file and I don't know why it isn't working.
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:~/.composer/vendor/bin:$PATH
Any ideas how to fix this?
Yuck, how did that happen? Try this:
PATH=/bin:/usr/bin:/usr/local/bin:$PATH
export PATH
Whether this works is going to depend on where you have been installing user executables. If you're using homebrew, I would expect it to be /usr/local/bin but perhaps it is something different in your case? You might want to try putting /usr/local/bin first so things installed by homebrew get picked up before the defaults in /usr/bin and /bin (this is what I do, and I'm still alive to talk about it...)
You could also change your default shell back to Bash:
brew install bash
echo '/usr/local/bin/bash' >> /etc/shells
chsh
You might need to use sudo on line 2.
Before I start, let me say that I looked at all the similar questions and it appears that no one had this particular problem:
I installed git.
Next I ran this from the command line:
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
My result is
bash: line 151: git: command not found
bash: line 153: git: command not found
ERROR: Unable to clone the RVM repository, attempted both git:// and https://
What did I do wrong here? I am attempting to install this on osx Lion.
Additionally, can someone explain to me what the beginning of the bash command does? bash < <(...)
Just for my own curiosity :)
Thanks!
You need to have git installed first. The command executes the script downloaded with curl from the given url using bash. The <(...) is apparently used to provide a list of commands as per http://tldp.org/LDP/abs/html/process-sub.html.
You either installed git wrong, or it's not in your path. Have you installed XCode? It should automatically install git 1.7.4 and put it in your path. You'll also need to have XCode installed to be able to compile any ruby versions using RVM.