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

A.B.
  • 89,123
  • 21
  • 245
  • 323
user721015
  • 3
  • 1
  • 6

2 Answers2

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

A.B.
  • 89,123
  • 21
  • 245
  • 323
0

Also you can change root permissions by:

sudo chown root:user(yourusername) filename
Kulfy
  • 17,416
  • 26
  • 64
  • 103