warning: Insecure world writable dir when I run a

2019-01-13 00:46发布

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.

5条回答
聊天终结者
2楼-- · 2019-01-13 01:08

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.

查看更多
甜甜的少女心
3楼-- · 2019-01-13 01:15

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

...

查看更多
We Are One
4楼-- · 2019-01-13 01:20

Just chmod go-w /opt/local/bin at a shell prompt (depending on permissions you may need to sudo to do that).

查看更多
Animai°情兽
5楼-- · 2019-01-13 01:27

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.

查看更多
够拽才男人
6楼-- · 2019-01-13 01:28

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.

查看更多
登录 后发表回答