I was trying to install jekyll in my Mac and got the warning as following:
WARNING: You don't have /Users/Carrot/.gem/ruby/2.3.0/bin in your PATH, gem executables will not run.
I checked through gem list and it shows it is installed; and I can find the jekyll through the path "/Users/Carrot/.gem/ruby/2.3.0/bin". I read a post which seems like my situation. I would like to know if it's a must to go through sudo
? I now prefer to uninstall everything (since it also installed sass and bunch of things at the same time) and go through homebrew. How can I do the uninstallation?
Many thanks!
For those who have problems with @lamech-desai answer, (actually, when they do Desai's commands, it apparently works temporarily for them). So you can easily do these:
open ~/.bshrc
if you would like to use bash or ~/.zshrc
if your are using zsh or etc...
$ sudo nano .bashrc ## bash users
$ sudo nano .zshrc ## zsh users
then copy and past these two lines of codes at the end of the .*rc file:
export GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
export PATH="$PATH:$GEM_HOME/bin"
then simply press ctrl+s
and ctrl+x
. This will save the changes to .bashrc
but you won't see them immediately - directly on your next shell login with your current user. One way to see the changes immediately is to switch user to root with su root
and then switch back to your previous user with su <username>
- and voila, your .bashrc
will be reloaded. You can also check this with echo $PATH
.
Thanks to @lamech-desai for great answer
If you are using arch linux just use the commands below in your terminal
[user~]$ export GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
[user~]$ export PATH="$PATH:$GEM_HOME/bin"
[user~]$ gem list
[user~]$ gem update
You need to add the directory to your PATH environment variable
https://askubuntu.com/questions/406643/warning-you-dont-have-a-directory-in-your-path-gem-executables-will-not-run
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With