在安装或者运行ruby相关的程序时,有时会报
ruby warning: Insecure world writable dir /usr/local/bin, mode 040777
Ruby (on all Unixes, including Cygwin) warns if you try to run an external program and your $PATH contains a world-writable directory. It doesn't just check the directories on $PATH: it checks each of their parents, too, because if /usr/local (say) is world-writeable, /usr/local/bin is subverted as easily as if it were writeable itself
Cygwin seems to ship with various directories world-writable, so you get warnings if you run a Ruby script that runs external programs: ehughes:~$ uname -a CYGWIN_NT-5.0 ehughes 1.5.18(0.132/4/2) 2005-07-02 20:30 i686 unknown unknown Cygwin ehughes:~$ ruby -e 'system("echo")' -e:1: warning: Insecure world writable dir /usr/local/bin, mode 040777 ehughes:~$ ruby -e '`echo`' -e:1: warning: Insecure world writable dir /usr/local/bin, mode 040777 ehughes:~$
这时可以将报错的目录权限修改下:
chmod o-w /usr/local/bin chmod o-w /usr/local chmod o-w /usr
然后
~$ source /etc/profile
或者重启系统
ok 再试就没问题了