`-bash: rbenv: command not found` comes up every time I open a terminal on window. How do I fix this? - rbenv

I have this bash: rbenv: command not found thing always coming up on my terminal whenever I open it and they appear four times as shown below.
I am using windows, please, how do I fix this? All solutions I have researched are tailored toward MacOs.
bash: rbenv: command not found
bash: rbenv: command not found
bash: rbenv: command not found
bash: rbenv: command not found

I am using windows, please, how do I fix this? All solutions I have researched are tailored toward MacOs.
The error is coming from bash, a Unix shell. It's unclear how that's running on Windows (perhaps Windows Subsystem for Linux?) but the MacOS (really Unix) instructions should work.
Presumably you installed rbenv in this Unix on Windows environment at some point and now it's gone. If you want it back, install it again.
If you want it gone, follow the uninstall instructions. rbenv will add a line rbenv init to your shell startup configuration files. In bash, look at your .bashrc and .bash_profile files in your home directory and remove anything to do with rbenv.
If you don't know how to use bash, see Introduction to Bash for more.

Related

Direnv not allowing me to allow

I've installed direnv (v2.18.2) onto my Ubuntu 16.04 machine using:
sudo snap install direnv
as per the website, and added the line:
eval "$(direnv hook bash)"
to my ~/.bashrc file as per the instructions. When I navigate into the directory with my .envrc file, the following message shown:
direnv: error .envrc is blocked. Run `direnv allow` to approve its content.
Sweet. So I run direnv allow, and I'm immediately hit with exactly the same error. I've also tried using direnv allow . but that doesn't seem to help. Also, completely restarting my laptop hasn't helped either.
All the advice I've seen is for direnv not finding the .envrc file, but here it is finding it, it's just not allowing me to allow it.
I know this is not a propper solution, but I encountered this aftering installing from a snap on Linux Mint.
After I uninstalled the snap and installed it from aptitude I did not have any issues.
While the OP is on Ubuntu I ran into the same problem with the snap installed binary on CentOS 7.7.
I worked around the problem by installing a go binary and then building direnv from source: git clone https://github.com/direnv/direnv.git; cd direnv; make; make install which got me direnv 2.21.2 in /usr/local/bin

How do I stop iTerm2 from running xcodebuild and hanging when I open a window?

Since this morning, on my iMac (macOS High Sierra Version 10.13.6) any time I open an iTerm2 window (with Oh My Zsh installed), I see this:
It seems that it's trying to run xcodebuild and it's stuck. I never get a prompt, even after waiting a long time. I've tried pressing ctrl+C to end the process, and then I see this:
I'm not purposely trying to do anything with Xcode. I just want to use the command line. I've been working for months without this problem, and it just started today. Any suggestion for how I can resolve this and use iTerm like normal?
I had the similar issue.
This resolved the problem:
# sudo xcodebuild -license accept
I got the same issue with macOS Big Sur.
Tried all Google results and nothing works. Eventually, I found it was caused by setting Node.js v8.x as default in nvm, alias default to system will resolve the issue. Although I don't know why nvm need to run xcodebuild for Node.js v8.x.
I have got the same issue after updating my MBP16 with Big Sur today
I have checked my xcode command tools path with xcode-select -p and I found that the path was related to an older version of xcode (10.1 in my case, I do not remember the path, maybe /Applications/Xcode_10.1.app/Contents/Developer/).
I have reinstall xcode command tools (sudo rm -rf /Library/Developer/CommandLineTools and xcode-select --install) and I have switched the xcode command tools path with this command sudo xcode-select -switch /Library/Developer/CommandLineTools
The issue is resolved now
Many answers but at the first start the console is still very slow (15s).
Looking around I found out that somehow nvm needs xcodebuild.
The slowdown was fixed changing the nvm default to system
nvm alias default system
Still not well clear why this is happening, I suggest to figure out trying to change the nvm configuration until you obtain the result.
The hanging I was experiencing happened only once after reboot, and consequent launches of the shell happened instantly.
I've spent hours debugging this issue. I eventually traced the hanging to homebrew's start script. My finding was that /usr/bin/git was slow at start (took 12 secs to load) for some reason and Homebrew used that binary unless another was installed. I installed a newer version of git through Homebrew using brew install git and this fixed the issue.
Investigation
I could see that the hang causes 100% CPU usage in syspolicyd and I could see a -67062 error at the end of the hang through Console.app (this error means code object is not signed at all). Unfortunately, the error log did not point me to a specific file and I had to add echos inside the brew script to isolate the exact location of the hang. It turned out to be an execution of git. Installing another version of git that would overwrite the default one fixed the problem. I used brew install git since homebrew checks its own directory first for a git binary.
I am not exactly sure how/why the code signature of /usr/bin/git is broken. It wasn't broken when I first installed Homebrew. It was somehow corrupted later on.

zsh: command not found: rabbitmq-server

I've been following the RabbitMQ installation guide via homebrew.
It says to add a line to my .bash_profile, but since I'm using ohmyzsh for my terminal I'm guessing I have to edit my .zshrc file.
I've tried adding the following possibilities:
PATH=$PATH:/usr/local/sbin
export PATH=$PATH:/usr/local/sbin
export PATH=/usr/local/sbin:$PATH
Unfortunately none of them worked.
Elsewhere in the .zshrc file I see this line: export ZSH=/Users/robinkim/.oh-my-zsh. This may give a clue as to what needs to be added.
EDIT: I simply forgot to brew link rabbitmq
as said in the edit you must type brew link rabbitmq in your terminal
For me the solution was to run
brew services start rabbitmq

CMake missing modules directory

I've installed CMake 2.8.11.2 package from CMake's website for Mac 64-bit. We recently upgraded a project from Qt 4 to Qt 5 and the CMake upgrade is mandatory for CMake to use Qt 5. However, when I type cmake . I get the following error:
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/Applications/CMake 2.8-11.app/Contents/bin
CMake Error: Error executing cmake::LoadCache(). Aborting.
I can confirm, there is no modules directory in the bin folder. I really don't know how to resolve this error, or how to get the modules needed.
Do hash -r to clear the cache, then do cmake --version.
It should work.
I had the same problem after upgrading on Ubuntu.
Removing cmake and the cmake-data package before performing the update solved it for me.
sudo apt-get remove cmake cmake-data
Now perform the update via
sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x
sudo -E apt-get update
sudo apt-get install cmake
This worked for me :
cd cmake-3.4.3
./bootstrap --prefix=/usr
make
sudo make install
Additionally, you may encounter the same error when running CMake from Cygwin. This may be caused by a PATH variable listing /bin before /usr/bin: in this case CMake is launched as /bin/cmake instead of /usr/bin/cmake, and trying to load modules from //share/cmake-X.Y.Z (which is a UNC path on Windows) instead of /usr/share/cmake-X.Y.Z.
Explicitly export'ing a correct CMAKE_ROOT isn't helpful, and cmake keeps displaying the same misleading message.
The issue can be solved by setting PATH to /usr/bin:/bin:/everything/else in your .bash_profile.
I was able to fix this error on Linux (for other who may be searching for answer on Linux) while trying to upgrade cmake 2.8.11 to 2.8.12 by exporting the CMAKE_ROOT environment variable like so:
export CMAKE_ROOT=/path_to_install/cmake-2.8.12.2-Linux-i386/share/cmake-2.8
The share directory should be on the same level as your bin directory.
I got the same error message upgrading cmake-3.5.1 to cmake-3.7.1 on Ubuntu 16.04.01 LTS. I just updated the repositories with
sudo apt-get update
Then
cmake --version
brought up the correct and upgraded cmake version and the error messages was gone.
In my opinion/case this is a developer "problem". I suspect this occurs mostly to new developers so I go a bit deeper to put it in the right perspective:
To "not mess with" the original system files used for daily work and separate the new compiled and volatile programs in a separate location it is common to not just change but add/mount a complete folder structure similar to the original OS folder structure in a special "development" location.
So more or less a mirrored folder structure of the original one but connected/linked to the original resources.
There for we need to add an environment variable to our user bash profile where we tell the system: "link our development folders to the following direction/dir."
On Arch Linux this is done in a file in ~/.bashrc - that is linked/forwarded in/by the ~/.bash_profile ("~" stands for /home/your user name/) and MacOS/Unix will be similar.
To do that there are 2 ways:
you can open the .bashrc file and add your environment path to the bottom of it
or
you can use "export" to put the environment variables to the right place in your user bash file.
for kde development e.g. you need to add a path at the end of the ~/.bashrc file like so:
# Adding the kdesrc-build directory to the path
export PATH="$HOME/kde/src/kdesrc-build:$PATH"
what basically tells the system: the development is done in the /home/user name/kde/src folder - there are your files. You can choose where you want to locate your development environment.
If you execute cmake it "thinks" your files are in the original OS folder and the "Could not find CMAKE_ROOT" - message will disappear because it finds all your files since properly linked from your development folder structure to your system folder structure.
So basically to solve the problem you could just execute cmake in the right system folder - it just could mess up your system if the program or make files are not proper done so it is pulled to the home folder development folder structure. And you just have to tell that cmake, so it can find all needed files to compile your stuff, including the CMAKE_ROOT.
Another problem could be that cmake isn't properly installed.
On Arch Linux systems that can be made sure by using the "sudo pacman -Syu cmake" command and it copies the files in the right direction and sets the right user variables to get it executed and reinstall cmake if necessary.
Btw, if you are on other systems like Debian make sure to use a Debian apt repository, it can differ from the Ubuntu repository, especially if you compile for the chosen system.
I tried to write a general "beginners in mind" overview to get em a fundamental picture. Executing cmake in the right folder solved that exact problem for me that was asked for.
(Actual that flags works for the actual cmake version from the official arch repository:
1:
cd /home/ivanovic/kde/src/program_name
than:
2:
cmake -S/home/ivanovic/kde/src/program_name -B/home/ivanovic/kde/build/program_name -DCMAKE_INSTALL_PREFIX=/home/ivanovic/kde/usr -DCMAKE_BUILD_TYPE=Debug
Pay attention that between -S and /home/... is no space, same at -B and /home/...
This worked fine for my kde system software builds.
)
If anyone gets the following error:
Modules directory not found in
/usr/share/cmake-3.20
cmake version 3.20.2
Solution which worked for me:
sudo cp -r /share/cmake-3.20 /usr/share/
The above command copies the cmake-3.20 directory from /share to /usr/share
This also happened to me on a fresh install of Ubuntu 21.04 and was fixed by installing it from "snap":
sudo snap install cmake --classic
(and then making sure that /snap/bin is in $PATH)
tl;dr: check the permission of folder /usr/local/share/cmake-x.xx.
I had a similar problem with the cmake that I build from source code. I compile the code with the following command.
./configure
make
sudo make install
and the binary files were placed into /usr/local/bin as expected. But I will encounter the same problem when executing cmake without sudo privilege. This is because the normal user don't have reading permission with folder /usr/local/share/cmake-3.xx.
The error went away when I give myself the permission to read/execute, with the command.
sudo chmod 755 /usr/local/share/cmake-3.xx
(xx will be the specific version that you installed.)

RVM is not a function in Raspbian RVM Installation

I'm looking for a solution to the "RVM is not a function" issue when installing RVM on Raspbian using LXTerminal. The following thread discusses workarounds for this issue:
rvm installation not working: "RVM is not a function"
One solution would be to start the terminal in "login mode" by doing /bin/bash --login, but this does not help on Raspbian because it uses LXTerminal. Other people have suggested putting the following line at the end of your .bash_rc file:
source ~/.rvm/scripts/rvm
...which seems to work. Just wondering if (a) the above workaround is legit and will not screw anything up and (b) if anybody has found a more elegant solution for RVM on Raspbian.
It looks like the best solution is to run it with:
lxterminal -e "bash -li"
It will make the terminal use an login and interactive shell.
I tried this but when in the root application directory for a ruby on rails application it stopped working, I added this 'source /usr/local/rvm/scripts/rvm' to my .bashrc file which worked in the /home/user/ folder and the root ruby on rails application folder