`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:
In order to use the system ruby with rvm just pickup it by execution:
rvm mount /path/to/system/ruby
Then create a gemset:
rvm gemset create bitnami
And use it:
rvm gemset use bitnami
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
Is Time.Zone.Now.To_Date Equivalent to Date.Today
How to Instruct Capistrano 3 to Load My Shell Environment Variables Set at Remote Host
How Does Pack() and Unpack() Work in Ruby
Removing Child Root Nodes in Rabl
In Ruby, Should I Use ||= or If Defined? for Memoization
Watir. Scroll to a Certain Point of the Page
Dynamically Define Named Classes in Ruby
Can't Run Jenkins Build - Bundle: "Command Not Found"
Differencebetween "Rails S" and "Bundle Exec Rails S"
Weird Rails Error "Permission Denied: Bin/Rails" for Old Rails Apps
Rails Before_Filter for Specific Actions in Controller
Rails: Switch Connection on Each Request But Keep a Connection Pool
How Does MACports Install Packages? How to Activate a Ruby Installation Done via MACports
String Interpolation When Not Using a String Literal
Simple_Form's Collection_Radio_Button and Custom Label Class