hanyi

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

在安装或者运行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  再试就没问题了


posted on 2011-12-29 18:00  hanyi  阅读(1342)  评论(0编辑  收藏  举报