最佳答案
我正在尝试安装 Jekyll。在运行 gem install jekyll
之后,我得到这个错误:
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /usr/local/lib/ruby/gems/2.0.0/gems/jekyll-1.0.3/CONTRIBUTING.md
当我运行 gem list
时,我可以看到 Jekyll 已经安装好了,所以我完全糊涂了:
*** LOCAL GEMS ***
bigdecimal (1.2.0)
classifier (1.3.3)
colorator (0.1)
commander (4.1.3)
directory_watcher (1.4.1)
fast-stemmer (1.0.2)
highline (1.6.19)
io-console (0.4.2)
jekyll (1.0.3)
json (1.7.7)
kramdown (1.0.2)
liquid (2.5.0)
maruku (0.6.1)
minitest (4.3.2)
posix-spawn (0.3.6)
psych (2.0.0)
pygments.rb (0.5.1)
rake (0.9.6)
rdoc (4.0.0)
rubygems-update (2.0.3)
safe_yaml (0.7.1)
syntax (1.0.0)
test-unit (2.0.0.0)
yajl-ruby (1.1.0)
过去我的用户路径有很多问题,所以我想知道这个错误是否与此有关?
以下是 gem env
的输出:
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.3
- RUBY VERSION: 2.0.0 (2013-02-24 patchlevel 0) [x86_64-darwin12.3.0]
- INSTALLATION DIRECTORY: /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0
- RUBY EXECUTABLE: /usr/local/Cellar/ruby/2.0.0-p0/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/Cellar/ruby/2.0.0-p0/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
- /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0
- /Users/me/.gem/ruby/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
下面是我的“ . bash _ profile”:
export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
PATH=$PATH:above/path/to/gems
source ~/.rvm/scripts/rvm
谁能帮我安装一下 Jekyll 或者至少帮我解决一下这个权限错误?