Permission Error When Trying To Install Rails (OSX)
Your rbenv
installation was incorrectly installed as it had elevated privileges which caused your user account to not have write access to ~/.rbenv
.
Issue the following command in order to take of ownership of the directory:
sudo chown -R Russell_Silver ~/.rbenv
Note that some users may have a different rbenv
directory, e.g. /usr/local/var/rbenv
. This would take the place of ~/.rbenv
in the above command. Why do I get a permission denied error while installing a gem?
Your Ruby is installed in /usr/local/Cellar/ruby/...
.
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.
Error installing rails - permission denied when running 'gem install rails'
You could make this:
sudo chown -R "$USER": ~/.rbenv
This function for me.
Related Topics
Why The Unit Test Frameworks in Fortran Rely on Ruby Instead of Fortran Itself
Rack: How to Store The Url as a Variable
How to Tell Unicorn to Understand Heroku's Signals
How to Access Parent/Sibling Module Methods
Good Forms Helpers for Sinatra
How to Convert Ruby Formatted JSON String to JSON Hash in Ruby
Rails: What's Wrong with This Multiple Join with Conditions on The Associations
Ruby a Clever Way to Execute a Function on a Condition
How to Mass Rename Files in Ruby
Can't Get Paypal Encrypted Website Payments to Work in Rails
Operator Precedence of Unary Operators
Ubuntu 10 Ruby 1.9 Rails 3: No Such File or Directory
Changing The Reading Order of Rubygem Sources
How to Programmatically Remove "Singleton Information" on an Instance to Make It Marshal