[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debian-devel:16338] rubyã®LOAD_PATH



ã“ã‚“ã«ã¡ã¯ï¼Œ

ruby ã® LOAD_PATH ㌠. ã‚’å«ã‚“ã§ã„ã‚‹ã“ã¨ãŒæ°—ã«ãªã£ã¦ã„ã¾ã™ï¼Žä»–ã®è¨€èªžã§
ã¯é€šä¾‹ãã†ã„ã†ã“ã¨ã¯ã—ã¦ã„ãªã„ã¨ã„ã†å‰ä¾‹ãŒã‚ã‚‹ã“ã¨ã‹ã‚‰ä½•ã‹è„†å¼±æ€§ãŒã‚ã‚‹
ã®ã‹ï¼Œã¨ã„ã†ç‚¹ãŒä¸å®‰ã§ã™ï¼Ž

Debian ã§ã¯ apt-listbugsãªã©ãŒroot権é™ã§å‹•ä½œã—ã¦ã„ã‚‹ãŸã‚ã«ï¼Œ
rubyã«è„†å¼±æ€§ãŒã‚ã‚‹ã¨ï¼Œroot権é™ã‚’å–å¾—ã§ãã‚‹ã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž



LOAD_PATHã®æœ€å¾Œã« '.' ãŒæ¥ã¦ã„ã‚‹ãŸã‚,require è¡Œã§è©²å½“ã™ã‚‹ãƒ•ã‚¡ã‚¤ãƒ«ãŒå­˜
在ã—ã¦ã„ãªã„å ´åˆã«ã®ã¿ '.' ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ã¨ã„ã†ã“ã¨ã«ãªã‚‹ã¨æ€ã„ã¾ã™ï¼Ž
root 権é™ã§ CWD=/tmp ã®å ´åˆã«ä»»æ„ã®ã‚³ãƒ¼ãƒ‰ã‚’実行ã§ãる,ã¨ã„ã†ã®ãŒå¥½ã¾
ã—ããªã„çµæžœã«ãªã‚‹ã¨æ€ã„ã¾ã™ãŒï¼Œã†ã¾ããれを実ç¾ã™ã‚‹æ–¹æ³•ãŒãŠã‚‚ã„ã¤ãã¾
ã›ã‚“.

$ ruby -e '$:.each{|l| print l+"\n"}'
/usr/local/lib/site_ruby/1.8
/usr/local/lib/site_ruby/1.8/x86_64-linux
/usr/local/lib/site_ruby
/usr/lib/ruby/1.8
/usr/lib/ruby/1.8/x86_64-linux
.



上å·
-- 
dancer@{debian.org,netfort.gr.jp}   Debian Project