Can't get Jekyll running anymore

I’ve been running Jekyll in the past on my Mac, but it doesn’t work anymore. When I try the command bundle exec jekyll build in my sites dir I’ll get:

bundler: command not found: jekyll
Install missing gem executables with bundle install

I allready tried reinstalling Ruby, Bundler and Jekyll, but it didn’t work. Googling my error didn’t help too. Who has any idea?

what is the full console log? was that it?

Seems like most of the time this is related to how/where ruby is involved - sometimes ruby gets installed in 2 places and it doesn’t work.

Hi Rdyar,

This two lines are the only message I’ve got. Is there someone to check if Ruby is installed in two places?

what do you get if you just do jekyll build?

it looks like it is saying jekyll is not installed, try gem install jekyll, then jekyll build.

usually if jekyll is installed but not happy it gives you a lot more log info, in there you can see that ruby is installed in 2 places sometimes. But yours seems to be that it can’t find jekyll.

On one of my computers (Mac, Catalina) I had a similar thing yesterday. After messing around with many Brew, bundle etc. calls I removed the entire gems directory in ~. There is also a .gem, which I left. Then ran
brew update; brew upgrade
went into my Jekyll directory, ran
gem update bundler; bundle update; gem update
Everything downloaded and installed w/o error, and then
JEKYLL_ENV=production bundle exec jekyll serve
worked as usual. Possibly some of the above are overkills :).
Best, Michael

Thanks for the help, rdyar!

This gives:

zsh: command not found: jekyll

This gives:

ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

So I gave the dir write right and than this command gives:

Fetching jekyll-4.0.0.gem
ERROR: While executing gem … (Errno::EACCES)
Permission denied @ rb_sysopen - /Library/Ruby/Gems/2.6.0/cache/jekyll-4.0.0.gem

Problem is /Library/Ruby/Gems/2.6.0/cache/jekyll-4.0.0.gem doesn’t exist. Any idea?

Don’t really know if deleting whole dirs is a good idea to just try some things…

I could not agree more… But after >½hr trying to decipher arcane error messages, googling for similar situations… Anyway, that directory was not present before I started with Jekyll :).

I’d try what he said, can’t hurt too much? at least if jekyll is the only ruby thing you use.

I’m not a mac person so not sure I can help with the permissions issue.

I would try what michael said, then if that doesn’t work i would uninstall ruby and try re-installing it. A couple people lately have said the same thing more or less as you - following the same instructions and it didn’t work on a mac.

I’d also poke around and see if ruby is installed twice - not sure how to do that, I know sometimes it ends up in /usr - look around/search in there to see if you see it?

try running gem env and see what you get.

Hey
I am facing the same issue. Were you able to fix it? If yes, how?
Thanks

Try to install again new site (fresh installation from scratch)

Hi Michael - I am facing a similar issue with Ruby 2.7.0. However, I have no gems folder in my home dir, but .gems has both 2.6.0 and 2.7.0 directories, each of which has a gems folder. When you wrote “~” did you maybe mean ruby home? – Thanks Andy

FYI gem env includes:

  • GEM PATHS:
    • /usr/local/lib/ruby/gems/2.7.0
    • /Users/andrewdugas/.gem/ruby/2.7.0
    • /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/gems/2.7.0

Dear Andy:
With “~” I meant my user home folder. My current Ruby is also 2.7.0.
There, in my .GEM folder there was ruby and specs, and in ruby there was a 2.6.0 folder. Then there is also a ~/gems folder.

Just for the heck of it I thrashed both again, and ran the “all” selection in my makefile, which does:
brew update, brew upgrade, brew cleanup, gem update, gem update bundler, bundle update.
Rather an overkill :). This re-created both ~/.GEM and ~/gems, and Jekyll runs fine.

My gem env is a little different

  • GEM PATHS:
    • /Users/bach/gems
    • /Users/bach/.gem/ruby/2.7.0
    • /usr/local/lib/ruby/gems/2.7.0
    • /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/gems/2.7.0

and that explains (1at line) why ~/gems is created here.
I am not really on top of which paths should be there… Maybe I should play around and delete the first path. Hmm… Not sure if any of this helps you.

Thanks, Michael. I uninstalled, reinstalled, everything twice over. Still getting the same errors. Will search other topics in the forum or create a new one.

Thanks again.

This might help:

bundle config set path ‘vendor/bundle’ # to save gems to the vendor/bundle folder
bundle install

Then try:

bundle exec jekyll --help

To undo the above bundler configuration you can delete the created “.bundle” folder to remove the .bundle/config which sets the BUNDLE_PATH

Hope this helps

Make sure ruby is setup. This works for me on Catalina

brew install ruby

Add the following to your ~/.bashrc or ~/.zshrc file. This will ensure so that your user (Homebrew) install of Ruby will be found before the system Ruby.

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

Install bundler for your user. Use the flag to avoid sudo.

gem install bundler --user-local

Add jekyll to your Gemfile. Here, matching GH Pages version. Or ~> 4.1.

gem 'jekyll', '~> 3.9'

To avoid sudo use and permissions error, adjustment on above post comment, use local here too.

bundle config set --local path vendor/bundle
bundle install

And finally make sure your path in .zshrc or .bashrc includes path to your gems so bundler can be found.

Replace X.X.0 with your own Ruby version e.g. 2.6.0 (always end with 0 ).

export GEM_PATH="$HOME/.gem/ruby/X.X.0/bin"
export PATH="$GEM_PATH:$PATH"

Then

bundle exec jekyll build

Thank you, Michael. This works!
I’ve been trying to get it going on the Mac for ages.
Cheers!

1 Like

Excellent to hear that