gem install giving error that I can't change permissions.. chown and chmod not working

Posted by user2321289 on Stack Overflow See other posts from Stack Overflow or by user2321289
Published on 2013-11-01T21:51:19Z Indexed on 2013/11/01 21:53 UTC
Read the original article Hit count: 186

Filed under:
|
|
|
|

so I am trying to install hmac

gem install ruby-hmac -v 0.4.0

I am getting the following error message:

You don't have write permissions into the /opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1 directory

So the output from ls -l is as such:

ubuntu@ip-10-38-121-211:~/workspace/cf-release$ sudo ls -l /opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/

I perform a chown on this directory:

sudo chown -R ubuntu:ubuntu /opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/

Try to install the gem:

ubuntu@ip-10-38-121-211:~/workspace/cf-release$ sudo chown -v ubuntu:ubuntu  /opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/
ownership of `/opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/' retained as ubuntu:ubuntu 

I do another ls -l on the directory:

ubuntu@ip-10-38-121-211:~/workspace/cf-release$ ls -l /opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/
total 4
d--------- 8 ubuntu ubuntu 4096 Nov  1 20:43 1.9.1

Doing a chmod 777 to make the directory writeable:

 ubuntu@ip-10-38-121-211:~/workspace/cf-release$ sudo chmod -v 777 /opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/
 mode of `/opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/' retained as 0777 (rwxrwxrwx)
 ubuntu@ip-10-38-121-211:~/workspace/cf-release$ ls -l /opt/rbenv/versions/1.9.3-p448/lib/ruby/gems/
 total 4
 d--------- 8 ubuntu ubuntu 4096 Nov  1 20:43 1.9.1

Any idea as to why this would be acting up like this? I am at a loss here.. any help appreciated

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby