I'm attempting to install Jekyll. After running
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
*** LOCAL GEMS ***
- 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:
- GEM PATHS:
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
Your Ruby is installed in
That is a restricted path and can only be written to when you use elevated privileges, either by running as root or by using
sudo. I won't recommend you run things as root since you don't understand how paths and permissions work. You can use
sudo gem install jekyll, which will temporarily elevate your permissions, giving your command the rights needed to write to that directory.
However, I'd recommend you give serious thought into NOT doing that, and instead use your RVM to install Ruby into your own home directory, where you'll automatically be able to install Rubies and gems without permission issues. See the directions for installing into a local RVM sandbox in "Single-User installations".
Because you have RVM in your
~/.bash_profile, but it doesn't show up in your Gem environment listing, I suspect you either haven't followed the directions for installing RVM correctly, or you haven't used the all-important command:
rvm use 2.0.0 --default
to configure a default Ruby.
For most users, the "Single-User installation" is the way to go. If you have to use
sudo with that configuration you've done something wrong.