Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 1347 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to install a gem or update RubyGems if it fails with a permissions error

#1
I'm trying to install a gem using `gem install mygem` or update RubyGems using `gem update --system`, and it fails with this error:

```none
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
```

Does anyone have an idea how to solve this?
Reply

#2
> You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.

means exactly that, you don't have permission to write there.

That is the version of Ruby installed by Apple, for their own use. While it's OK to make minor modifications to that _if you know what you're doing_, because you are not sure about the permissions problem, I'd say it's not a good idea to continue along that track.

Instead, I'll strongly suggest you look into using either [rbenv][1] or [RVM][2] to manage a separate Ruby, installed into a sandbox in your home directory, that you can modify/fold/spindle/change without worrying about messing up the system Ruby.

Between the two, I use rbenv, though I used RVM a lot in the past. rbenv takes a more "hands-off" approach to managing your Ruby installation. RVM has a lot of features and is very powerful, but, as a result is more intrusive. In either case, *READ* the installation documentation for them a couple times before starting to install whichever you pick.

[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#3
The reason of the error is because you are not logged in as the root user on terminal.

If you already have root use enable on your mac in terminal type

$ su

If you dont have root user, you need to enable it using the following steps

1. From the Apple menu choose System Preferences….
2. From the View menu choose Users & Groups.
3. Click the lock and authenticate as an administrator account.
4. Click Login Options….
5. Click the “Edit…” or “Join…” button at the bottom right.
6. Click the “Open Directory Utility…” button.
7. Click the lock in the Directory Utility window.
8. Enter an administrator account name and password, then click OK.
9. Choose Enable Root User from the Edit menu.
10. Enter the root password you wish to use in both the Password and Verify fields, then click OK.

More at the same on

[To see links please register here]


Atleast it works for me after getting stuck for couple of hours.
Reply

#4
I needed to do a `rbenv rehash` so it would point to my local Gem library.

It looks like you've got your gem manager pointing to the System Library, so, instead of messing with permissions, do the equivalent of "rehash" for your manager to get things pointing locally.
Reply

#5
sudo gem update --system
sudo gem install (gemfile)
Reply

#6
Why don't you do:

sudo gem update --system
Reply

#7
I used this and worked.

`$ sudo chown myuser /var/lib/gems`
Reply

#8
cd /Library/Ruby/Gems/2.0.0

open .

right click get info

click lock

place password

make everything read and write.
Reply

#9
For me the problem was due to using `rbenv` and forgetting to set the proper version globally.

So I had to set it with `rbenv global xxx`

In my case I installed `2.0.0-p247` so I had to issue the command:

rbenv global 2.0.0-p247
rbenv rehash


Then all was working fine.
Reply

#10
Work for me:

sudo gem uninstall cocoapods

sudo gem install cocoapods
Reply



Forum Jump:


Users browsing this thread:
3 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through