在我更新到High Sierra之前一切正常,现在jekyll将无法运行。我卸载了jekyll,确保使用brew更新了ruby(已经安装了ruby 2.4.2_1),然后尝试重新安装jekyll。这是我从命令行得到的错误。
Last login: Sat Dec 9 20:15:25 on ttys000
Wills-MBP:~ Will$ sudo gem uninstall jekyll
Password:
Gem 'jekyll' is not installed
Wills-MBP:~ Will$ gem install bundle
Fetching: bundle-0.0.1.gem (100%)
Successfully installed bundle-0.0.1
Parsing documentation for bundle-0.0.1
Installing ri documentation for bundle-0.0.1
Done installing documentation for bundle after 0 seconds
1 gem installed
Wills-MBP:~ Will$ gem install jekyll
ERROR: While executing gem ... (Errno::EACCES)
Permission denied @ rb_sysopen -
/Library/Ruby/Gems/2.3.0/gems/jekyll-3.6.2/.rubocop.yml
Wills-MBP:~ Will$ sudo gem install jekyll
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
Wills-MBP:~ Will$ sudo gem install jekyll bundler
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
Wills-MBP:~ Will$ gem update --system
Updating rubygems-update
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
Wills-MBP:~ Will$
我找到了有问题的文件,但我无法通过操作系统的安全功能给自己写入权限。
截至目前,尚未安装jekyll,我只是想重新安装它并重新启动并运行。
有谁知道如何解决这个问题?
**快速说明,这是我运行这些命令时得到的......
Wills-MBP:~ Will$ which ruby
/usr/bin/ruby
Wills-MBP:~ Will$ which gem
/usr/bin/gem
所以我猜这意味着它指向我的系统,而不是/ usr / local。我该如何改变?
答案 0 :(得分:2)
我明白了!我在这里找到了答案。 https://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/#laptop-script
按照列出的步骤运行命令 酿酒医生
这给了我错误"警告:/ usr / bin发生在/ usr / local / bin" 所以我运行了故障排除指南https://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/#troubleshoot-brew
提供的命令echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile
确保退出终端并重新启动它。
之后我没有按照指南中的任何步骤进行操作,只需运行
gem install jekyll bundler
一切安装正确并且不错!
答案 1 :(得分:0)
更新到Mac OSX High Sierra后我遇到了同样的系统错误(10.13.4;虽然我不知道更新是相关的)
Permission denied @ rb_sysopen
发现正在运行:
sudo gem install jekyll
然后输入您的密码,将完成Jekyll安装。
此解决方案归功于TeamTreeHouse.com的Alexander Davison