warning: Insecure world writable dir when I run a ruby or gem command
Solution 1
Just chmod go-w /opt/local/bin
at a shell prompt (depending on permissions you may need to sudo
to do that).
Solution 2
To clarify, whatever path returns after it says insecure world writeable, is what you use.
So instead of: chmod go-w /opt/local/bin you would replace /opt/local/bin with whatever your path is.
Solution 3
Find your gem path so we can edit the bundler gem. Execute the following in your shell:
$ ruby -r rubygems -e "p Gem.path"
Navigate to your gem path and cd into the version of bundler currently being used. Now navigate to lib -> bundler and open runtime.rb in your favorite text editor. Add “$VERBOSE = nil” to line 2.
require "digest/sha1"
$VERBOSE = nil
module Bundler
class Runtime < Environment
include SharedHelpers
def setup(*groups)
# Has to happen first
clean_load_path
...
Solution 4
If your environment does not allow you to fix this error properly (i.e. ruby lives on a network share or some such), see this answer for a way to suppress the error.
Solution 5
In some cases (like mine), the stack goes deeper than opt/local/bin
. In that case, use
sudo chmod go-w opt/local/*/bin usr/local/*/bin opt/local/bin usr/local/bin
In any case, the error prompts where the insecure world is.
Related videos on Youtube
Trip
I program Ruby, C#, iOS, Node, and Augmented Reality for Unity3D. I write PostgreSQL, mySQL, SQLite, and MongoDB. I use Heroku, Amazon, Microsoft Azure. Creator of the Yoga Sutras App, Braidio Mobile, and Braidio. In my spare time, I teach Ashtanga Yoga. elephant trip AT gmail DOT com #happyToHelp
Updated on July 09, 2022Comments
-
Trip almost 2 years
Not sure why I'm getting this, but I just installed RVM, the new Ruby 1.9, and reinstalled a bunch of gems, and I get this
/Users/johnsmith/.rvm/rubies/ruby-1.9.1-p378/bin/gem:4: warning: Insecure world writable dir /opt/local/bin in PATH, mode 040777
Everything still runs otherwise, but I was wondering if there was a way I could get rid of it.
-
Kornel over 13 yearspossible duplicate of [ warning Insecure world writable dir](stackoverflow.com/questions/3952243/…)
-
glerYbo over 9 years
-
glerYbo over 9 years
-
Trip over 9 years@kenorb Eh.. this question was asked first
-
-
Trip about 14 yearsYes! you are a genius! And that concludes my successful installation of RVM, ruby 1.9, and the 64-bit challenge :D
-
Alex Martelli over 13 years@ming, any program running on your machine can put anything it wants in
/opt/local/bin
(so in particular any executable "shadowing" any system one and other such trojans) without so much as a by-your-leave: how is that not insecure?! -
Timulus over 12 yearsAre you saying that this answer is a terrible idea and using it will open up a huge security hole in my system?
-
Kirk Strobeck over 11 years
chmod: /opt/local/bin: No such file or directory
-
Ortwin Gentz over 8 yearsThis silences all output including output from rake tasks. Not what I want.
-
Davi Lima over 8 years
chmod go-w /usr/local/bin
in OSX -
bradpotts over 6 yearsthanks, this helped me sort out another problem related to the same issue