-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Error Installing Bundler - Parent Directory is World Writable but not Sticky #4599
Comments
im having the same exact issue :( |
Hi, can you please share the output of |
Here it is: System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in Thanks! |
Same problem when installing a new gem (bundle install). Environment
.... |
try |
.Tried sudo chmod 1777 ~/.bundle and got the same error when trying to install it. |
Having the same issue. ran Environment Details:
|
Can confirm this is happening with me too. --- ERROR REPORT TEMPLATE -------------------------------------------------------
Error details
Environment Bundler 1.12.5
path |
just install a older version of bundler |
I also experienced this bug, and it was also fixed by downgrading to 1.12.3. |
@domcleal any interest in looking into this? |
The error (from Ruby's temp helper) suggests there's a directory in ~/.bundle that is Try resetting all cache directories to a normal set of permissions:
The advice above for If you're still having the problem, please gist output from |
|
If there's some way to fix this inside of bundler, we should. A PR from someone who understands why this is happening would be 🚀 |
I'm struggling to think why it'd be happening, my best guess is that it's either an old bug (e.g. where ~/.bundle/cache dirs were created with a bad umask) or people have run commands to open permissions to fix some other problem. Some solutions that may help:
|
Thanks so much for all the help with this. However, here is the new error message I am receiving after installing the earlier bundle version: Could not find gem 'terminal-table (>= 1.6.0)' in any of the gem sources listed in your Gemfile or available on this machine. Any ideas? |
@domcleal: Here is my output from
|
@JARM876 you have lots of directories owned by root in your own directory, I'd guess you've been using Regarding your table_print error, I'd suggest filing a new issue with a copy of your Gemfile and |
find ~/.bundle/cache -type d -exec chmod 0755 {} + Fixed issue for me on Windows Subsystem for Linux fresh install. Thanks @domcleal |
Thanks @stevensona that worked for me. Maybe should inform others using WSL because your answer was difficult to find. |
@Zatara7 Any idea how to get the word out? |
You could possibly add a new issue here with the solution: I tried creating a subreddit for this but haven't had time to work on it. On Wed, Jun 22, 2016 at 4:48 PM, Adam Stevenson notifications@github.com
|
Try: chmod +t -R ~/.bundle source: GoRails |
Is this permission thing strictly necessary? It looks like it's coming from Ruby, but this wasn't happening before (downgrading correctly resolves the issue) so I'm curious why the change. FWIW, Bash on Windows users are going to have a hard time with this. The above fix doesn't actually work, since chmod doesn't actually yet modify ACL permissions for your Windows files (it only works in the virtual Linux partition). See microsoft/WSL#81. At the very least, it didn't seem to work for me, since ~/.bundle points to my C:\Users\Loren.bundle directory. |
1.12.x contains a new cache of gem information which is shared across multiple processes. My fix in 1.12.4 added the call to Ruby's mktmpdir to fix concurrency and corruption issues with the cache, but mktmpdir does enforce secure permissions causing the error. #4599 (comment) notes some alternatives. |
Using the command fixed for me: $ find ~/.bundle/cache -type d -exec chmod 0755 {} + And I'm using BashOnWindows |
I'm having the same issue and @base16soft command fixed the issue. |
(WSL on Windows 10)
However, I wander what's the root cause |
$ sudo chmod 755 -R ~/.rvm |
@stevensona +1 and the heaven, |
As we noticed in #4519, we need to use a temporary directory to hold compact index downloads so that multiple processes don't write to the same files at the same time and break everything. The fix for that was #4561, which added temporary directories to hold all files as they download, and then uses the (atomic) `FileUtils.cp` to move the completed downloads into place, so there is never a point where multiple processes are trying to write into the file at once. Unfortunately, using `Dir.mktmpdir` requires that the parent directory be _either_ world writable or sticky, but not both. Based on #4599, it looks like it's common for home directories to be both world writable and sticky. While that's a security problem by itself, it's not a big concern for Bundler and the compact index. So we want to let users continue to use Bundler, even with the compact index, without having to change the permissions on their home directories. This commit changes the `mktmpdir` call to create the temporary directory inside the default OS tempdir, which is typically `/tmp` or `/var/tmp` depending on distro. Since that directory is designed to hold other temporary directories, that change should (theoretically) reduce or eliminate the problem reported in #4599.
use /tmp for mktmpdir As we noticed in #4519, we need to use a temporary directory to hold compact index downloads so that multiple processes don't write to the same files at the same time and break everything. The fix for that was #4561, which added temporary directories to hold all files as they download, and then uses the (atomic) `FileUtils.cp` to move the completed downloads into place, so there is never a point where multiple processes are trying to write into the file at once. Unfortunately, using `Dir.mktmpdir` requires that the parent directory be _either_ world writable or sticky, but not both. Based on #4599, it looks like it's common for home directories to be both world writable and sticky. While that's a security problem by itself, it's not a big concern for Bundler and the compact index. So we want to let users continue to use Bundler, even with the compact index, without having to change the permissions on their home directories. This commit changes the `mktmpdir` call to create the temporary directory inside the default OS tempdir, which is typically `/tmp` or `/var/tmp` depending on distro. Since that directory is designed to hold other temporary directories, that change should (theoretically) reduce or eliminate the problem reported in #4599.
I think this is actually being caused by microsoft/WSL#352 - the .rvm, .gem, .bundle directories are all being created world-writeable. |
use /tmp for mktmpdir As we noticed in #4519, we need to use a temporary directory to hold compact index downloads so that multiple processes don't write to the same files at the same time and break everything. The fix for that was #4561, which added temporary directories to hold all files as they download, and then uses the (atomic) `FileUtils.cp` to move the completed downloads into place, so there is never a point where multiple processes are trying to write into the file at once. Unfortunately, using `Dir.mktmpdir` requires that the parent directory be _either_ world writable or sticky, but not both. Based on #4599, it looks like it's common for home directories to be both world writable and sticky. While that's a security problem by itself, it's not a big concern for Bundler and the compact index. So we want to let users continue to use Bundler, even with the compact index, without having to change the permissions on their home directories. This commit changes the `mktmpdir` call to create the temporary directory inside the default OS tempdir, which is typically `/tmp` or `/var/tmp` depending on distro. Since that directory is designed to hold other temporary directories, that change should (theoretically) reduce or eliminate the problem reported in #4599.
For those running into the file permissions issue, try fixing permissions by setting See issue microsoft/WSL#352 for details. Normally this is handled by the login process, but login isn't used by Bash on Windows. You'll have to add it directly to your |
@neurogenesis you can run
For some reason you can't pass options directly to the command in a shortcut target so you have to go through |
@pixeltrix : thx for the reply. For sure there are a few workarounds. Was just listing some additional installs that will break with the missing umask. The --login option doesn't read from /etc/passwd, so things like shell variables aren't set. I ended up adding Ideally this will be addressed further upstream so shells other than bash are first-class citizens too (invoking something like |
I saw several fixes for Windows but I run linux mint. I haven't found any commands in here that work for me yet. --Update-- So I ended up running find ~/.bundle/cache -type d -exec chmod +t {} + then which didn't work due to permissions, then I manually edited the permissions to allow all read and write to my system ruby gems folder then ran bundle install again and this time it was successful and installed a little pest called Installing bcrypt 3.1.11 with native extensions but I did not get the bundle complete message, only a return prompt then I ran bundle install for a second time and got the bundle complete! message then I could run my rails server command then I was able to get to my http://localhost:3000/users/sign_up page |
I'm closing this issue, if anyone is experiencing this issue - please open a new issue with the details of your problem. |
Error: no such file or directory |
Hi,
I received the following error when trying to install the bundler to use wpscan. Could anyone take a look and let me know what I'm doing wrong? I'm very new to all this. Thanks!
--- ERROR REPORT TEMPLATE -------------------------------------------------------
What did you do?
I ran the command
/Users/jodi-ann/.rvm/rubies/ruby-2.3.1/bin/bundle install
What did you expect to happen?
I expected Bundler to...
What happened instead?
Instead, what actually happened was...
Error details
Environment
Bundler 1.12.4
Rubygems 2.6.4
Ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
GEM_HOME /Users/jodi-ann/.rvm/gems/ruby-2.3.1@wpscan
GEM_PATH /Users/jodi-ann/.rvm/gems/ruby-2.3.1@wpscan:/Users/jodi-ann/.rvm/gems/ruby-2.3.1@global
RVM 1.27.0 (latest)
Git 2.8.1
rubygems-bundler (1.4.4)
without
Set for your local app (/Users/jodi-ann/wpscan/.bundle/config): "test"
orig_path
Set via BUNDLE_ORIG_PATH: "/Users/jodi-ann/.rvm/gems/ruby-2.3.1@wpscan/bin:/Users/jodi-ann/.rvm/gems/ruby-2.3.1@global/bin:/Users/jodi-ann/.rvm/rubies/ruby-2.3.1/bin:/Users/jodi-ann/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
orig_gem_path
Set via BUNDLE_ORIG_GEM_PATH: "/Users/jodi-ann/.rvm/gems/ruby-2.3.1@wpscan:/Users/jodi-ann/.rvm/gems/ruby-2.3.1@global"
--- TEMPLATE END ----------------------------------------------------------------
The text was updated successfully, but these errors were encountered: