简体   繁体   English

无法在macOS Sierra 10.12.6上安装jekyll

[英]Trouble installing jekyll on macOS Sierra 10.12.6

  1. Tried the original method of gem install jekyll and I get this error: 尝试了gem install jekyll的原始方法,但出现此错误:

    ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory. 错误:执行gem时...(Gem :: FilePermissionError)您没有对/Library/Ruby/Gems/2.0.0目录的写权限。

  2. Installed Xcode and command line tools. 已安装的Xcode和命令行工具。 Then followed up with installing homebrew using this command: 然后使用以下命令安装自制软件:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )" / 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 错误:无法链接所有补全,文档和联机帮助页:权限被拒绝-(../../../Homebrew/completions/zsh/_brew,/ usr / local / share / zsh / site-functions / _brew)在执行期间失败:/ usr / local / bin / brew更新--force

  4. These are my ruby and gem version: 这些是我的红宝石和宝石版本:

    • addressable (2.5.1) 可寻址的(2.5.1)
    • bigdecimal (default: 1.2.0) bigdecimal(默认值:1.2.0)
    • CFPropertyList (2.2.8) CFPropertyList(2.2.8)
    • colorator (1.1.0) 着色器(1.1.0)
    • ffi (1.9.18) ffi(1.9.18)
    • io-console (default: 0.4.2) io-console(默认值:0.4.2)
    • jekyll-sass-converter (1.5.0) jekyll-sass-converter(1.5.0)
    • jekyll-watch (1.5.0) jekyll-watch(1.5.0)
    • json (default: 1.7.7) json(预设值:1.7.7)
    • kramdown (1.14.0) kramdown(1.14.0)
    • libxml-ruby (2.6.0) libxml-ruby(2.6.0)
    • listen (3.0.8) 听(3.0.8)
    • minitest (default: 4.3.2) 最小测试(默认:4.3.2)
    • nokogiri (1.5.6) 诺基亚(1.5.6)
    • psych (default: 2.0.0) 心理(预设值:2.0.0)
    • public_suffix (2.0.5) public_suffix(2.0.5)
    • rake (default: 0.9.6) 耙(默认:0.9.6)
    • rb-fsevent (0.10.2) rb-fsevent(0.10.2)
    • rb-inotify (0.9.10) rb-inotify(0.9.10)
    • rdoc (default: 4.0.0) rdoc(默认值:4.0.0)
    • rubygems-update (2.6.12) rubygems更新(2.6.12)
    • sass (3.5.1) 无礼(3.5.1)
    • sass-listen (4.0.0) 萨斯(4.0.0)
    • sqlite3 (1.3.7) sqlite3(1.3.7)
    • test-unit (default: 2.0.0.0) 测试单位(预设值:2.0.0.0)

Please help! 请帮忙!

If you cannot get it to work you can always try Cloud9. 如果您无法使其正常运行,则可以随时尝试Cloud9。

Cloud9 offers a full development environment in the cloud (running Linux). Cloud9在云(运行Linux)中提供了完整的开发环境。 Their IDE is also quite good and their environments are also very useful for collaboration. 他们的IDE也非常好,他们的环境对于协作也非常有用。 Setting up Git is really simple (using the 'git clone' command). 设置Git非常简单(使用'git clone'命令)。 With Cloud9 you will be able to work from any computer with a browser, without installing anything. 借助Cloud9,您将可以在装有浏览器的任何计算机上工作,而无需安装任何程序。

  1. create a free account on Cloud9 ( https://c9.io ) 在Cloud9上创建一个免费帐户( https://c9.io
  2. create an empty project (Ubuntu) and follow these steps: 创建一个空项目(Ubuntu),然后按照下列步骤操作:
  3. type on the command line: gem install jekyll 在命令行上输入:gem install jekyll
  4. create an empty _config.yml file in the root 在根目录中创建一个空的_config.yml文件
  5. create a index.md file in the root 在根目录中创建一个index.md文件
  6. type on the command line: jekyll serve --host $IP --port $PORT --baseurl '' 在命令行上输入:jekyll serve --host $ IP --port $ PORT --baseurl''
  7. your website is now running 'locally' on Cloud9 您的网站现在在Cloud9上“本地”运行

The content of your index.md file: index.md文件的内容:

---
title: Home
---

Hello world!

With Cloud9 you can develop on Linux and feel like a pro. 使用Cloud9,您可以在Linux上进行开发,并且感觉像专家。 Try it! 试试吧! You will love it. 你会喜欢的。

Did you try running the command with sudo ? 您是否尝试使用sudo运行命令? for example sudo gem install jekyll bundler . 例如sudo gem install jekyll bundler This will ensure that you're running the command as an administrator. 这将确保您以管理员身份运行命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM