# Problems Add the brew ruby path to your shell config

**URL:** <https://talk.jekyllrb.com/t/problems-add-the-brew-ruby-path-to-your-shell-config/4736>\
**Category:** Uncategorized\
**Created:** [July 21, 2020, 6:39pm UTC](https://talk.jekyllrb.com/t/problems-add-the-brew-ruby-path-to-your-shell-config/4736 "2020-07-21T18:39:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![FerGomez411](https://avatars.discourse-cdn.com/v4/letter/f/a88e4f/32.png) [@FerGomez411](https://talk.jekyllrb.com/u/FerGomez411)\
**Post date:** [July 21, 2020, 6:39pm UTC](https://talk.jekyllrb.com/t/problems-add-the-brew-ruby-path-to-your-shell-config/4736/1 "2020-07-21T18:39:32Z")

</div>

Hi, I am completely new to Jekyll and using terminal in a Mac, so it may sound stupid but when installing ruby when I have to **add brew ruby path to your shell config** I just copied what it says:

“echo 'export PATH=”/usr/local/opt/ruby/bin:$PATH"’ \>\> ~/.bash\_profile"

and I get this error message:

zsh: permission denied: /Users/fergomez/.bash\_profile

and I do not know what to do,  
any help is appreciated  
FER

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [July 22, 2020, 8:16am UTC](https://talk.jekyllrb.com/t/problems-add-the-brew-ruby-path-to-your-shell-config/4736/2 "2020-07-22T08:16:28Z")

</div>

Perhaps you made a typo as you’d only get permission denied trying to execute the target file.

From the docs [https://jekyllrb.com/docs/installation/macos/](https://jekyllrb.com/docs/installation/macos/)

```auto
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile

```

zsh profile is more useful for you

I’d not even bother with profile files and rather go for RC files:

Open `~/.zshrc`

Add this line

```auto
export PATH="/usr/local/opt/ruby/bin:$PATH"

```

---

<div class="post-metadata">

**Author:** ![FerGomez411](https://avatars.discourse-cdn.com/v4/letter/f/a88e4f/32.png) [@FerGomez411](https://talk.jekyllrb.com/u/FerGomez411)\
**Post date:** [July 22, 2020, 12:16pm UTC](https://talk.jekyllrb.com/t/problems-add-the-brew-ruby-path-to-your-shell-config/4736/3 "2020-07-22T12:16:18Z")

</div>

Hi Michael, thanks for your willingness trying to help. I am not sure I fully understood what to do. You said open /.zshrc and add a line but I do not know where to open it from.  
My problem apparently is pretty similar to the one poster here (see link below, does it have anything to do with using the bash or zsh shell?):

> [@Failed installation attempts on MacOS Catalina](https://talk.jekyllrb.com/t/failed-installation-attempts-on-macos-catalina/3822/7):
>
> I had the same errors on macOS Catalina. First make sure that the .bash\_profile in your home directory includes this path: (Show hidden files in Finder on Catalina: cmd + shift + fn + period) export PATH="$HOME/.gem/ruby/2.6.0/bin:$PATH" With macOS Catalina, Apple is now using Zsh as the default shell. I solved the problem with switching the default shell to Bash. Run this command in Terminal: chsh -s /bin/bash

Below you have the gem env info in case it helps, again thanks for your time:

RubyGems Environment:

- RUBYGEMS VERSION: 3.0.3
- RUBY VERSION: 2.6.3 (2019-04-16 patchlevel 62) [universal.x86\_64-darwin19]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.6.0
- USER INSTALLATION DIRECTORY: /Users/fergomez/.gem/ruby/2.6.0
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
- GIT EXECUTABLE: /usr/bin/git
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /Users/fergomez/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
- RUBYGEMS PLATFORMS:
  - ruby
  - universal-darwin-19

- GEM PATHS:
  - /Library/Ruby/Gems/2.6.0
  - /Users/fergomez/.gem/ruby/2.6.0
  - /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0

- GEM CONFIGURATION:
  - :update\_sources =\> true
  - :verbose =\> true
  - :backtrace =\> false
  - :bulk\_threshold =\> 1000

- REMOTE SOURCES:
  - [https://rubygems.org/](https://rubygems.org/)

- SHELL PATH:
  - /opt/anaconda3/bin
  - /opt/anaconda3/condabin
  - /usr/local/bin
  - /usr/bin
  - /bin
  - /usr/sbin
  - /sbin

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [July 22, 2020, 5:15pm UTC](https://talk.jekyllrb.com/t/problems-add-the-brew-ruby-path-to-your-shell-config/4736/4 "2020-07-22T17:15:20Z")

</div>

Use this

```auto
nano ~/.zshrc

```

Or replace `nano` with `vim`. Or `code` if you use vscode

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [July 22, 2020, 5:16pm UTC](https://talk.jekyllrb.com/t/problems-add-the-brew-ruby-path-to-your-shell-config/4736/5 "2020-07-22T17:16:37Z")

</div>

That link is related but that might not be needed as there is a lot of detail there.

If you use ZSH then add the line to .zshrc

If you use Bash add it to .bashrc instead

Or add it to both
