How can I install Jekyll on OSX 10.11?

前端 未结 9 1651
自闭症患者
自闭症患者 2020-12-05 03:27
ERROR:  While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/jekyll

I\'m getting a permission error on trying to install Jekyl

相关标签:
9条回答
  • 2020-12-05 03:37

    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.

    0 讨论(0)
  • 2020-12-05 03:42

    If you cannot get it to work you can always try Cloud9.

    Cloud9 offers a full development environment in the cloud (running Linux). Their IDE is also quite good and their environments are also very useful for collaboration. Setting up Git is really simple (using the 'git clone' command). With Cloud9 you will be able to work from any computer with a browser, without installing anything.

    1. create a free account on Cloud9 (https://c9.io)
    2. create an empty project (Ubuntu) and follow these steps:
    3. type on the command line: gem install jekyll
    4. create an empty _config.yml file in the root
    5. create a index.md file in the root
    6. type on the command line: jekyll serve --host $IP --port $PORT --baseurl ''
    7. your website is now running 'locally' on Cloud9

    The content of your index.md file:

    ---
    title: Home
    ---
    
    Hello world!
    

    With Cloud9 you can develop on Linux and feel like a pro. Try it! You will love it.

    0 讨论(0)
  • 2020-12-05 03:43

    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
      
    0 讨论(0)
  • 2020-12-05 03:43

    Don't install Jekyll with Homebrew, The security of Homebrew is unknown : https://security.stackexchange.com/questions/105088/osx-homebrew-security-risks

    Here is how you install it without homeBrew: with a vanilla OSX el cap: http://digitalshore.io/how-to-install-jekyll-mac-os-x-el-capitan/

    Update 1:

    The only drawback is that you have to type in your password everytime you use sudo, which isnt a big deal. I rather do that than install more dependencies. You should host your Jekyll config on github anyway, that way you wont have to deal with the command line at all. Here is my article on how to set Jekyll up with github: http://stylekit.org/blog/2016/01/06/The-Jekyll-Setup/

    Update 2:

    Since then i've made a 30 second video tutorial on how you can setup a jekyll blog on github: https://vimeo.com/154566844

    0 讨论(0)
  • 2020-12-05 03:45

    It seems this was an OS specific issue. I found a similar issue here, and the answer I found here helped solve the problem : Cannot install cocoa pods after uninstalling, results in error

    0 讨论(0)
  • 2020-12-05 03:50

    The new El Capitan version of OS X has a new technology called SIP that won't let users (even when using sudo) write to the /usr/bin folder. This breaks the install process. You can disable SIP, but I'd prefer to keep it on since it provides protection against bad stuff.

    SIP does allow writing in the /usr/local folder so what I did was manually install ruby there using brew and then install jekyll. That worked fine.

    sudo brew install ruby
    
    0 讨论(0)
提交回复
热议问题