0

I need to install bundler for an application so here's what I'm doing (instructions from the application documentation directly):

  1. mkdir ~/.gems
  2. export GEM_HOME=~/.gems
  3. gem install bundler -v 1.10.3

After doing these three instructions, I run bundler -v and get the following exception:

-bash: /usr/local/bin/bundle: Permission denied

It works fine if I run it as sudo. I also understand it's a permissions issue because root is the user and group on the folder. I guess the question is how can I install bundler without using the /usr/local folder so that I have access to it without using root?

[EDIT]

When I run ls -l /usr/local/bin/bundle I see the following:

-rwx------ 1 root root 495

When I run ls ld ~/.gems I see the following:

drwx------ 10 gflouis1 domain users 143 /home/gflouis1/.gems

FYI: gflouis1 is my username

5
  • Did you run mkdir ~/.gems as root also (e.g. using sudo)? Dec 14, 2015 at 15:59
  • I actually don't remember. If not, could that be a reason as to why I'm getting this exception? I'm pretty sure I didn't though since it was in the documentation.
    – user721015
    Dec 14, 2015 at 16:03
  • Please edit your question to include the outputs of ls -l /usr/local/bin/bundle and ls -ld ~/.gems Dec 14, 2015 at 16:05
  • Edits have been made.
    – user721015
    Dec 14, 2015 at 16:10
  • What if you do gem install bundler -v 1.10.3 --user-install?
    – muru
    Dec 15, 2015 at 8:45

2 Answers 2

1

Without sudo you don't have the necessary permissions, so add the executable bit for the group and others:

sudo chmod +x /usr/local/bin/bundle

0

Also you can change root permissions by:

sudo chown root:user(yourusername) filename

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .