How do I install ruby gems on Mac

brew update
brew install ruby

# If you use bash
echo 'export PATH=/usr/local/Cellar/ruby/[version]/bin:$PATH' >> ~/.bash_profile 

# If you use ZSH:
echo 'export PATH=/usr/local/Cellar/ruby/[version]/bin:$PATH' >> ~/.zprofile

# Note:
# Replace [version] with the install version for example: 2.4.1

You can do that but I suggest using an Environment Manager for Ruby.

You have rbenv and RVM. IMO go for rbenv:

brew install rbenv ruby-build

# bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile  

# zsh
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zprofile
echo 'eval "$(rbenv init -)"' >> ~/.zprofile  

# list all available versions:
rbenv install -l

# install a Ruby version:
rbenv install [version]

# set ruby version for a specific dir
rbenv local [version]

# set ruby version globally
rbenv global [version]

rbenv rehash
gem update --system

# Note:
# Replace [version] with the install version for example: 2.4.1

For more information check

https://stackoverflow.com/questions/39381360/how-do-i-install-ruby-gems-on-mac

Share:

More Posts

March 2022 – Kids on the Yard PR

“I can relate to this! Parents having a very tough time keeping their kids educational on track…” Sarah Maruani, a first-grade teacher, has founded Kids

Happy smiling arab schoolgirl using phone for virtual online study at home.

Online Summer Camp 2022

Numerous schools are supplying online guideline to struggling visitors. Unfortunately, there is an absence of research study on the effect of online small-group analysis intervention,

Share on facebook
Share on twitter
Share on linkedin

Sign up for our newsletters

SEO

Book Now Free SEO Consultation

Commerce

Take your ecommerce site to next the level

Development

Website Development