Every time I open terminal I get:
/Users/me/.zprofile:1: no such file or directory: /opt/homebrew/bin/brew
/Users/me/.zprofile:2: no such file or directory: /opt/homebrew/bin/brew
Can someone help how to remove this?
.zprofile is generally used as a profile config file for Z shell. In OSX if you've installed brew using Rosetta terminal the exec location would be most likely in /usr/local/bin/brew. You can replace /opt/homebrew/bin/brew with this location or you can just check it using which brew to get the bin location of homebrew and replace it in .zprofile file.
Related
I am trying to install Ruby on a remote server using rbenv.
However, when I run the command rbenv install 2.7.2, I get the error below:
ruby-build: TMPDIR=/tmp cannot hold executables (partition possibly mounted with noexec)
I have rbenv and other dependencies for the Ruby programming language properly installed.
After a few research and trials, I was able to solve it.
Here's how I solved it:
The issue was that the rbenv installer needed a directory to store temporary files while it is downloading and installing ruby, however, the /tmp directory which is the default directory for storing temporary files wasn't accessible by my current user.
I tried to change permissions for the /tmp directory to allow it become accessible to my current user, however, I was unsuccessful.
All I had to do was to create a new tmp directory in the home directory of my user:
mkdir ~/tmp
Next, I opened the .bashrc file in the home directory of my user:
sudo nano ~/.bashrc
Next, I added the line below to the bottom of the file and saved:
export TMPDIR="$HOME/tmp"
Finally, I restarted my terminal or ran the command below to load the newly added paths into my current shell/terminal session:
exec "$SHELL"
Now, I could run the command rbenv install 2.7.2 and it worked fine.
Resources: TMPDIR=/tmp cannot hold executables (partition possibly mounted with noexec)
Adding to the OP's answer, you don't need to create a new tmp folder. Only adding to the path should work as well.
I installed composer using home brew on my Utilities terminal on my Mac.
When I try to use packages installed through composer, I get that it isn't installed. For example, I can run laravel new appname in the Mac terminal, but it won't let me run it in VScode terminal (using zsh). I get the error zsh: command not found: laravel.
Can someone help so that the VScode terminal uses the packages installed in my Mac terminal?
My /etc/paths file looks like this:
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Users/melaniecarr/.composer/vendor/bin
You need to add the relevant directories to your PATH in ~/.zshenv. Try which laravel in the shell that works to see what directories you need to add. E.g.:
❯ which watch
/usr/local/bin/watch
❯ export PATH="/usr/local/bin:$PATH" # needs to be in ~/.zshenv to be permanent
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)"
I installed macvim with homebrew and when i tip "mvim file" in terminal open the file in another window. Can I fix and open mvim in terminal?
The binary is needed by some plugins (YouCompleteMe), for one.
You can use the binary that is installed with macvim. By default, it's
/usr/local/Cellar/macvim/8.0-144_3/MacVim.app/Contents/MacOS/Vim
You can simply alias vim to it in your shell config (.bashrc, .zshrc, etc.)
alias vim=/usr/local/Cellar/macvim/8.0-144_3/MacVim.app/Contents/MacOS/Vim
MacVim (mvim) is not a terminal application. If you want to open vim in a terminal, just use "vim" instead.
We want the contents of the MacVim.app package to be in the PATH, but do this cleanly. So here's what I do:
cd /Applications; ln -s ../usr/local/Cellar/macvim/8.1-151_1/MacVim.app
That gets you MacVim in /Applications, via a symlink that can be updated when the package is upgraded. Then add this to the PATH in the shell startup file:
PATH=/Applications/MacVim.app/Contents/bin:$PATH
Then when you upgrade you just change the symlink in /Applications and everything still works nicely.
I just installed ssldump on a mac computeg using brew. The installation process ran without reporting any issues (ssldump-0.9b3 already installed). However, when I try running ssldump from the same prompt or a new terminal window, the error message I get is:
-bash: ssldump: command not found
Is there anything else that i need to do to make this work on a Mac El capitan (v10.11.6)?
Simply using brew install ssldump did not work for me as ssldump was added in /usr/local/sbin (which was neither mentioned on /etc/paths nor in .bash_profile). I ended up adding /usr/local/sbin to the .bash_profile and used sourced the file to enable the change.
cd ~
sudo vi .bash_profile
add to the file:
export PATH=/usr/local/sbin:$PATH
&
source .bash_profile