Bundle Install' Failed Due to Permission Denied

`bundle install` failed due to permission denied

I found !

I had updated my rubygem like this gem update --system. But only my local gems were update due to the gem: --user-install restriction in my /etc/.gemrc. When bundler works, it use the global rubygem and not mine.

To fixe this issue, I updated the global rubygems with : sudo gem update --system --no-user-install.

And all works fine !

Bundle install: permission denied

Please make sure the:

ls -l /opt/bitnami/ruby/lib/ruby/site_ruby/2.1.0/x86_64-linux/

say that the folder belongs to you, not to root:root. If the rights are for root user, you can't create the folder, so to fix it just do:

sudo chown bitnami:bitnami /home/bitnami/. -R

I strongly advice you to use rvm and gemset in order to not using the root operations. Do as follows:

  1. In order to use the system ruby with rvm just pickup it by execution:

    rvm mount /path/to/system/ruby
  2. Then create a gemset:

    rvm gemset create bitnami
  3. And use it:

    rvm gemset use bitnami
  4. Update or install all gems into the specified gemset, but don't use sudo for the action, just:

    bundle install

Getting permission denied error when I run gem install bundler

you are using the system's ruby and now you need to root level permission to to install bundler. Sudo enables root privileges. Check if your account has root privileges.

I prefer using a version and manager like rbenv. Install rbenv . then install the required version of ruby and then install bundler.

Bundle Install Fails (Permission denied @ rb_sysopen)

I had a similar issue. Clearing the bundler's cache worked for me.

rm -rf ~/.bundle/cache

I get permission denied error while trying to run bundle install

I retried with sudo now and it works. How can U make it work without sudo

To make bundler work without sudo, you should install all your gem dependencies in a local user directory (this is the recommended way)

bundle install --path vendor/bundle

Now when you run your program, bundle will find all your libraries in the new location

bundle exec ruby app.rb

If you are using git, make sure to add vendor to your .gitignore to avoid having all your gem libraries in your "new files" list.

Why do I get a permission denied error while installing a gem?

Your Ruby is installed in /usr/local/Cellar/ruby/....

That is a restricted path and can only be written to when you use elevated privileges, either by running as root or by using sudo. I won't recommend you run things as root since you don't understand how paths and permissions work. You can use sudo gem install jekyll, which will temporarily elevate your permissions, giving your command the rights needed to write to that directory.

However, I'd recommend you give serious thought into NOT doing that, and instead use your RVM to install Ruby into your own home directory, where you'll automatically be able to install Rubies and gems without permission issues. See the directions for installing into a local RVM sandbox in "Single-User installations".

Because you have RVM in your ~/.bash_profile, but it doesn't show up in your Gem environment listing, I suspect you either haven't followed the directions for installing RVM correctly, or you haven't used the all-important command:

rvm use 2.0.0 --default

to configure a default Ruby.

For most users, the "Single-User installation" is the way to go. If you have to use sudo with that configuration you've done something wrong.



Related Topics



Leave a reply



Submit