Search code examples
rubyjekyllrbenv

Struggling installing Jekyll on El Capitan


I'm having issues getting Jekyll working on El Capitan. Well, any Gem really. All my Gem installs failed, and I found out it was because of Apple's System Integrity Protection, and the recommended solution is to use ruby versioning tool RBENV.

  • Installed rbenv and ruby-build using homebrow
  • Installed Ruby 2.3.0
  • Set rbenv global to 2.3.0
  • ran rbenv init and added it to ~/.zshenv so my path now looks like: /usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/thuijls/.rbenv/shims
  • gem install works fine, I installed jekyll and some other gems. No drama, everything installed to /usr/local/bin/gems.
  • ran rbenv rehash

Running any of them tho:

/usr/local/bin/jekyll:22:in `load': cannot load such file -- /Library/Ruby/Gems/2.0.0/gems/jekyll-3.0.3/bin/jekyll (LoadError)
from /usr/local/bin/jekyll:22:in `<main>'

They still try to access Apple's standard Ruby in /Library/, which is where none of those Gems are installed.

Any suggestions?


Solution

  • Although I don't use rbenv, try these few steps:

    • run brew prune to fix the system's symlinks;
    • fix any other issues indicated by brew doctor;
    • use .bash_profile in your home folder instead of ~/.zshenv

    If it still doesn't work, try using RVM:

    • install it with an argument to set up your PATH properly with: \curl -sSL https://get.rvm.io | bash -s stable --auto-dotfiles
    • set RVM to use Homebrew to install any necessary dependencies with rvm autolibs enable && rvm autolibs packages && rvm autolibs homebrew
    • install ruby-2.3.0: rvm install 2.3.0
    • go ahead and install any gem on your current gemset