Trouble installing jekyll on macOS Sierra 10.12.6

◇◆丶佛笑我妖孽 提交于 2019-12-24 10:56:22

问题


  1. Tried the original method of gem install jekyll and I get this error:

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

  2. Installed Xcode and command line tools. Then followed up with installing homebrew using this command:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  3. get this error after:

    Error: Failed to link all completions, docs and manpages: Permission denied - (../../../Homebrew/completions/zsh/_brew, /usr/local/share/zsh/site-functions/_brew) Failed during: /usr/local/bin/brew update --force

  4. These are my ruby and gem version:

    • addressable (2.5.1)
    • bigdecimal (default: 1.2.0)
    • CFPropertyList (2.2.8)
    • colorator (1.1.0)
    • ffi (1.9.18)
    • io-console (default: 0.4.2)
    • jekyll-sass-converter (1.5.0)
    • jekyll-watch (1.5.0)
    • json (default: 1.7.7)
    • kramdown (1.14.0)
    • libxml-ruby (2.6.0)
    • listen (3.0.8)
    • minitest (default: 4.3.2)
    • nokogiri (1.5.6)
    • psych (default: 2.0.0)
    • public_suffix (2.0.5)
    • rake (default: 0.9.6)
    • rb-fsevent (0.10.2)
    • rb-inotify (0.9.10)
    • rdoc (default: 4.0.0)
    • rubygems-update (2.6.12)
    • sass (3.5.1)
    • sass-listen (4.0.0)
    • sqlite3 (1.3.7)
    • test-unit (default: 2.0.0.0)

Please help!


回答1:


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.




回答2:


Did you try running the command with sudo ? for example sudo gem install jekyll bundler. This will ensure that you're running the command as an administrator.



来源:https://stackoverflow.com/questions/45805271/trouble-installing-jekyll-on-macos-sierra-10-12-6

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!