Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I created a new user in CentOS 6.3 using this commands

useradd deployer

passwd deployer

visudo

then I added this line to file:

deployer ALL=(ALL) ALL

Fine!

Now I trying to install rbenv, to deploy an RoR application. I followed this steps:

cd /home/deployer

su deployer

curl https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash

It worked. After, I added rbenv to .bashrc and tried to reload .bashrc file and get this error:

[deployer@mycentos ~]$ . ~/.bashrc 
bash: /home/deployer/.rbenv/bin/rbenv: Permission denied

Anyone know why?

share|improve this question
add comment

2 Answers

It looks like you're not getting your environment set correctly when you do su deployer. Try sudo -iu deployer, so that you get the environment of that user as well.

share|improve this answer
add comment
up vote 0 down vote accepted

Solved!

I was getting this error because /home folder was mounted with noexec option.

$cat /etc/fstab 
...
/dev/mapper/VG00-LVhome /home  ext4    defaults,noexec,nosuid        1 2

Now, I changed app to /usr folder and it works!

Thank you!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.