Cyril Duchon-Doris
Cyril Duchon-Doris

Reputation: 13949

bundle error missing file only in sudo

I don't understand the following error :

If I run sudo bundle on my rails app folder, it runs fine. Without the sudo however, I get a permission denied :

/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir': Permission denied - /usr/local/rvm/gems/ruby-2.0.0-p353/extensions/x86-linux/2.0.0/bcrypt-3.1.9 (Errno::EACCES)
   from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:245:in `fu_mkdir'
   ....

Okay, but I checked the said folder [...]/x86-linux/2.0.0/, and the folder /bcrypt-3.1.9 doesn't even exist ! (However I do have a folder bcrypt-ruby-3.1.2)

What's wrong ? How can I fix that

Upvotes: 1

Views: 98

Answers (1)

Adrian
Adrian

Reputation: 15171

The failing command is mkdir, which is trying to create that directory. So that's why the directory doesn't exist.

If you are using linux or osx, you can use the chmod command to change the permissions for that directory, for example

chmod -R 755 /usr/local/rvm/gems/ruby-2.0.0-p353/extensions/x86-linux/2.0.0

Unfortunately there are too many potential things to list here which would cause filesystem permissions errors like the one you are getting. I would recommend posting the output of ls -l /usr/local/rvm/gems/ruby-2.0.0-p353/extensions/x86-linux/2.0.0 if you still can't fix it.

Upvotes: 2

Related Questions