Try the following:

sudo apt-get install rubygems
Answer from Thomas on Stack Overflow
🌐
Moncef Belyamani
moncefbelyamani.com › troubleshooting-command-not-found-in-the-terminal
How to fix "command not found" after installing gems
March 17, 2023 - Another reason why commands might ... is because those changes don’t take effect right away. You have to “refresh” it by either using the source command, such as: source ~/.zshrc ·...
Discussions

Installation probelm: zsh: command not found: jekyll - Jekyll Talk
I am having difficulty installing Jekyll. The gem gets is installed but when I issue jekyll serve i get zsh: command not found: jekyll Would really appreciate it if somebody could help me out? More on talk.jekyllrb.com
🌐 talk.jekyllrb.com
0
March 23, 2020
Cannot run gem executables

I did confirm that the rubocop executable is in /usr/local/lib/ruby/gems/2.7.0/bin. Do I need to add this directory to $PATH?

Yes, the bin directory needs to be in your path. A little trick I use to keep the current version's directory in the PATH is something like this in .bashrc (or .zshrc whatever it is for you)

export PATH="$PATH:$(ruby -e 'puts Gem.user_dir')/bin"
More on reddit.com
🌐 r/ruby
2
3
June 11, 2020
zsh: command not found: colorls
Description After running gem install colorls I get this message: ******************************************************************* Changes introduced in colorls Sort by dirs : -sd flag has been ... More on github.com
🌐 github.com
22
February 28, 2019
rubygems - Why does ZSH return "Command not found" error for my RVM gems? - Stack Overflow
I used to run the default bash terminal that comes with Mac Os X Lion but have recently upgraded to ZSH with the Oh My Zsh addon. Since then I get an odd error when using Ruby gems. In essence all gems return a "Command not found" error even though they are installed. More on stackoverflow.com
🌐 stackoverflow.com
May 12, 2014
🌐
Jekyll Talk
talk.jekyllrb.com › t › installation-probelm-zsh-command-not-found-jekyll › 4116
Installation probelm: zsh: command not found: jekyll - Jekyll Talk
March 23, 2020 - I am having difficulty installing Jekyll. The gem gets is installed but when I issue jekyll serve i get zsh: command not found: jekyll Would really appreciate it if somebody could help me out?
🌐
Super User
superuser.com › questions › 495465 › gem-binaries-not-found-with-oh-my-zsh
ruby - Gem Binaries not found with oh-my-zsh - Super User
October 29, 2012 - I'm using Oh-My-Zsh on Mountain Lion and have an issue with gem binaries not loading properly. For instance: If I load a new shell the binary still cannot be found. When using Bundler, I can load
🌐
Reddit
reddit.com › r/ruby › cannot run gem executables
r/ruby on Reddit: Cannot run gem executables
June 11, 2020 -

I installed Ruby via Homebrew so I didn't f-up my system Ruby. I then started a project and installed some executable gems (Jekyll and rubocop). However, when I try to run either command, I receive the error zsh: command not found.

Here is my gem env output:

RubyGems Environment:
  - RUBYGEMS VERSION: 3.1.2
  - RUBY VERSION: 2.7.1 (2020-03-31 patchlevel 83) [x86_64-darwin19]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.7.0
  - USER INSTALLATION DIRECTORY: /Users/onetwobus/.gem/ruby/2.7.0
  - RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
  - GIT EXECUTABLE: /usr/local/bin/git
  - EXECUTABLE DIRECTORY: /usr/local/lib/ruby/gems/2.7.0/bin
  - SPEC CACHE DIRECTORY: /Users/onetwobus/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.7.1_2/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-19
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/2.7.0
     - /Users/onetwobus/.gem/ruby/2.7.0
     - /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/gems/2.7.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/opt/ruby/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin

I did confirm that the rubocop executable is in /usr/local/lib/ruby/gems/2.7.0/bin. Do I need to add this directory to $PATH?

🌐
GitHub
github.com › athityakumar › colorls › issues › 264
zsh: command not found: colorls · Issue #264 · athityakumar/colorls
February 28, 2019 - zsh: command not found: colorls#264 · Copy link · Labels · question · dylanjm · opened · on Feb 28, 2019 · Issue body actions · After running gem install colorls I get this message: ******************************************************************* Changes introduced in colorls Sort by dirs : -sd flag has been renamed to --sd Sort by files : -sf flag has been renamed to --sf Git status : -gs flag has been renamed to --gs Clubbed flags : `colorls -ald` works Help menu : `colorls -h` provides all possible flag options Tab completion enabled for flags -t flag : Previously short for --tree, has been re-allocated to sort results by time -r flag : Previously short for --report, has been re-allocated to reverse sort results Man pages have been added.
Author   dylanjm
Find elsewhere
🌐
SvennD
svennd.be › gem-command-not-found
gem: Command not found - SvennD
January 19, 2018 - While installing a ruby package I hit the error : gem install --version 1.15.4 bundler make: gem: Command not found make: *** [setup] Error 127 This can be resolved by installing the package : yum -y install rubygems-devel or for the Debian friends apt-get install rubygems Happy building 🙂
🌐
GitHub
github.com › athityakumar › colorls › issues › 149
ZSH .gem/ruby/2.4.0/gems/colorls-1.0.9/lib/tab_complete.sh:4: command not found: complete · Issue #149 · athityakumar/colorls
October 30, 2017 - ZSH .gem/ruby/2.4.0/gems/colorls-1.0.9/lib/tab_complete.sh:4: command not found: complete#149 · Copy link · Labels · Language:Bashbug · disque-monde · opened · on Oct 30, 2017 · Issue body actions · Bug in existing feature · Zsh error after write source $(dirname $(gem which colorls))/tab_complete.sh in my .zshrc on Arch Linux ·
Author   disque-monde
🌐
Stack Overflow
stackoverflow.com › questions › 29087905 › zsh-not-finding-terminal-command
bash - zsh not finding terminal command - Stack Overflow
I'm trying to read every line of a file with some gems, for instance this is a line from the gems.txt: active_directory -v 1.6.0. while read line do "gem dependency $line --remote" done
🌐
CopyProgramming
copyprogramming.com › howto › gem-command-not-found
Ruby: Gem Command not found
May 24, 2023 - To add it to the system's $PATH , create a new file in /etc/profile.d/rubygems.sh with the following content. ... Ensure that the executable is added to your path. It might be necessary to refresh everything by restarting your terminal. Zsh: command not found: bundle (after gem install bundle), ...
🌐
Salayhin
salayhin.wordpress.com › 2016 › 08 › 01 › zsh-command-not-found-bundle-error
zsh: command not found: bundle error | Salayhin
January 17, 2017 - I have installed zsh in my ubuntu 16.04, but after install rails when trying to bundle install I found following error in my console: zsh: command not found: bundle (after gem install bundle) After searching on google I found following solution from stackoverflow.com: echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv echo 'eval "$(rbenv init -)"' >> ~/.zshenv…
🌐
GitHub
github.com › twitter › twurl › issues › 156
After install all I get is twurl: command not found · Issue #156 · twitter/twurl
To Reproduce I'm using Xubuntu 20.04, fairly new install so a fresh install of ruby was required. This is the output of my sudo gem env command:
Author   ghost
🌐
GitHub
github.com › ohmyzsh › ohmyzsh › issues › 6190
Rails no longer working after installing oh-my-zsh · Issue #6190 · ohmyzsh/ohmyzsh
July 15, 2017 - Update: Here is the error chain, when I try and run any rails command: Rails is not currently installed on this system. To get the latest version, simply type: $ sudo gem install rails You can then rerun your "rails" command.
Author   d00medman
🌐
Ruby on Rails
discuss.rubyonrails.org › rubyonrails-talk
why ???zsh: command not found: rails - rubyonrails-talk - Ruby on Rails Discussions
March 26, 2012 - $gem install rails -n /home/steven/.rvm/gems/ruby-1.9.2-p318/bin -l Successfully installed rails-3.2.2 1 gem installed Installing ri documentation for rails-3.2.2... Installing RDoc documentation for rails-3.2.2... $rvm use 1.9.2 $ rails -v zsh: command not found: rails
🌐
Jesse Squires
jessesquires.com › blog › 2020 › 08 › 26 › zsh-could-not-find-cocoapods
zsh could not find CocoaPods · Jesse Squires
August 26, 2020 - zsh: command not found: pod · The only thing that changed recently was installing the most recent supplemental update. Otherwise, nothing with my configuration or environment has changed. Even more strange is that other Ruby gems seemed to work fine, like jekyll.