RubyGems and Homebrew are package managers. RubyGems was created to set up gems, while Homebrew is a more general tool that can create, install, and manage various software packages, including gems.
Homebrew is tied to Mac OS X, while RubyGems runs on multiple platforms.
The best advice? Do what the book / textbook you are following tells you to do and let your preferences evolve over time until you have enough experience to know what you want. All of this, as has been said, it looks like you're going to work in Rails, so you're going to use bundler, not RubyGems or Homebrew.
Mars atomomic
source share