# jekyll: problem with gem env \>\> -bash: command not found

**URL:** <https://talk.jekyllrb.com/t/jekyll-problem-with-gem-env-bash-command-not-found/5499>\
**Category:** Help\
**Created:** [January 12, 2021, 9:11pm UTC](https://talk.jekyllrb.com/t/jekyll-problem-with-gem-env-bash-command-not-found/5499 "2021-01-12T21:11:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ablodola](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/ablodola/32/3137_2.png) [@ablodola](https://talk.jekyllrb.com/u/ablodola)\
**Post date:** [January 12, 2021, 9:11pm UTC](https://talk.jekyllrb.com/t/jekyll-problem-with-gem-env-bash-command-not-found/5499/1 "2021-01-12T21:11:09Z")

</div>

so I’m struggling running Jekyll I’m a newb). I had it working the other day but after I tried hosting it in Github pages it stopped working and I keep getting `-bash: jekyll: command not found`

I’ve tried deleting all gems, reinstalling everything and so on. I installed Jekyll using Homebrew. If I do `gem env` I get the following and I think the problem must be with the shell pat and/or gem path.

```auto
RubyGems Environment:
  - RUBYGEMS VERSION: 3.2.3
  - RUBY VERSION: 3.0.0 (2020-12-25 patchlevel 0) [x86_64-darwin19]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/3.0.0
  - USER INSTALLATION DIRECTORY: /Users/alessandrolodola/.local/share/gem/ruby/3.0.0
  - RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
  - GIT EXECUTABLE: /usr/local/bin/git
  - EXECUTABLE DIRECTORY: /usr/local/lib/ruby/gems/3.0.0/bin
  - SPEC CACHE DIRECTORY: /Users/alessandrolodola/.local/share/gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/3.0.0_1/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - x86_64-darwin-19
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/3.0.0
     - /Users/alessandrolodola/.local/share/gem/ruby/3.0.0
     - /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/gems/3.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/alessandrolodola/.gem/ruby/3.0.0/bin
     - /Users/alessandrolodola/.gem/ruby/3.0.0/bin
     - /Users/alessandrolodola/.gem/ruby/X.X.0/bin
     - /usr/local/opt/ruby/bin
     - /Users/alessandrolodola/.gem/ruby/3.0.0/bin
     - /usr/local/opt/ruby/bin
     - /Users/alessandrolodola/.gem/ruby/3.0.0/bin
     - /usr/local/opt/ruby/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /opt/X11/bin
     - /Library/Frameworks/Mono.framework/Versions/Current/Commands

```

I’m guessing I need to delete some of these redundant folders which I must have created accidentally as I’m learning on the fly here. Would it maybe be easier to reinstall everything. If so, what is the best way to do it and make sure I have a clean installation. Thanks in advance for the help.

---

<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:** [January 13, 2021, 7:47am UTC](https://talk.jekyllrb.com/t/jekyll-problem-with-gem-env-bash-command-not-found/5499/2 "2021-01-13T07:47:22Z")

</div>

Hi.

For Jekyll use, I’d first suggest downgrading Ruby

```auto
brew uninstall ruby
brew install ruby@2.7

```

And comment out everything from bashrc and zshrc file around ruby paths so you can start clean.

And yes you can delete any folders around gems.

It looks like you are using Bash, so only your bash configs matter.

Here are my instructions for setup on mac.

> <https://gist.github.com/MichaelCurrin/61053a564bdb3098bae11f949bab3578>

As in that doc, I’d recommend using Jekyll as a project gem installed with bundle, rather than as a global gem

---

<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:** [January 13, 2021, 7:54am UTC](https://talk.jekyllrb.com/t/jekyll-problem-with-gem-env-bash-command-not-found/5499/3 "2021-01-13T07:54:37Z")

</div>

And based on your initial post, I looks like you want to use Jekyll globally.

Ruby 3 is not ready yet for Jekyll use but here is what you can do for global Jekyll

This is already in your path (though with 3 instead of 2.7), which means Jekyll could be found if installed there.

```auto
/Users/alessandrolodola/.gem/ruby/3.0.0/bin

```

You could install Jekyll as

```auto
gem install jekyll --user-install 

```

For GH pages you need Jekyll 3.9 so I you need to add something like `--version 3.9`.

And you must also install `kramdown-parser-gfm`, which is needed for 3.9 (but not 3.8 or 4).

In a Gemfile for use with bundle:

> <https://github.com/MichaelCurrin/jekyll-blog-demo/blob/master/Gemfile#L3-L4>
