Byebug - errors while installing

Saras-MacBook-Pro:ruby-project saraginsburg$ gem install byebug
Fetching: byebug-9.0.6.gem (100%)
ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
Saras-MacBook-Pro:ruby-project saraginsburg$

If you’ve installed rbenv and ruby, this likely means that your bash_profile hasn’t been updated correctly. Your terminal runs your bash profile every time you open up a new terminal, so we have to make sure that it directs to rbenv.

Run these two lines in the terminal, one after the other:

echo ‘export PATH="$HOME/.rbenv/bin:$PATH"’ >> ~/.bash_profile

echo ‘eval “$(rbenv init -)”’ >> ~/.bash_profile

This will put those two lines in your bash_profile.