How can I install Jekyll on OSX 10.11?
This is a side effect of Apple's new rootless (aka System Integrity Protection or SIP) feature in OS X El Capitan, but it does not affect /usr/local/bin.
You might try the following:
sudo gem install -n /usr/local/bin/ jekyll
This tells gem to install Jekyll into a folder that isn't protected by SIP, rather than the default protected location under /Library/Ruby/Gems
.
This is the solution suggested by Jekyll's developers.
Jekyll and OSX 10.11 GM
So i worked out what the actual issue was!
Apple has added System Integrity Protection (SIP) to increase security. This means that Jekyll has been effected as it uses the default Ruby install.
More details on SIP.
To get around this other users have been installing the Homebrew version. It's also likely that Jekyll v3.0 will start to move towards using this version too.
Install the Xcode command line utilities:
xcode-select --install
Install Homebrew (instructions at http://brew.sh)
Modify
$PATH
to use Homebrew:export PATH=/usr/local/bin:$PATH
Modify
$PATH
for GUI apps:launchctl setenv PATH "/usr/local/bin:$PATH"
Install the latest Ruby:
brew install ruby
Install the latest Jekyll:
gem install jekyll
Struggling installing Jekyll on El Capitan
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
jekyll installed but 'command not found'
Okay I had to check what exatly does the $PATH means, and for what it is.
The problem was simple, somehow my ruby installion directory wasnt in my $path variable.
Useful links: Mac OS X: Set / Change $PATH Variable
Okay so here is the thing how I solved it:
echo "$PATH"
gem uninstall jekyll
find / -name jekyll (to delete if there is any leftovers somewhere )
gem environment ( get EXECUTABLE DIRECTORY path )
nano $HOME/.bash_profile ( go to the end of document and insert a new line )
export PATH="/usr/local/Cellar/ruby/2.0.0-p247/bin:$PATH"
you can do this on a templorary way by just writing it in terminal and not saving it in your .bash_profile
Jekyll - command not found
The easiest method of doing this is to use RVM. It manages Ruby and all its gems for you and it's easy to use. See this link for using it.
If you did not want to use that you will need to modify your PATH variables so it can find your gems. I have found this to be tedious and reverted to RVM, but here are the general steps.
You will need to find out where your gems are getting installed. If you did gem install ...
the gems will be in ~/.gem/ruby/1.8/gems/bin
, if you used sudo gem install ...
the gems will be somewhere in /System/Library/Frameworks/Ruby.framework/Versions/1.8/Resources
You have to add this path to your PATH variable. Easiest way to do this is by running :echo 'PATH=$PATH:above/path/to/gems' >> ~/.bash_profile
Related Topics
How to Use Hash Keys as Methods on a Class
How to Enable Cors in Rails 4 App
How to Make Part of a Regular Expression Optional in Ruby
3 Equals or Case Equality Operator
Uninstall Old Versions of Ruby Gems
How (Replace|Create) an Enum Field on Rails 2.0 Migrations
Bundler Cannot Install Any Gems Without Sudo
Paperclip Renaming Files After They'Re Saved
Why Do This Ruby Object Have Both To_S and Inspect Methods That Appear to Do the Same Thing
How to Configure Ruby on Rails with Oracle
Get Single Char from Console Immediately
Rails on Windows - Install Issue
In 'Require': No Such File to Load -- Iconv (Loaderror)
Why Do People Say That Ruby Is Slow