From: Phillip Gawlowski Date: 2011-10-06T22:34:50+09:00 Subject: Re: a dream: gem require auto-installer On Thu, Oct 6, 2011 at 3:19 PM, Regis d'Aubarede wrote: > or I can do   that at the beginning of my script : > >        def my_require(gem,pack=nil)  require gem >        rescue Exception => e >            puts "loading #{pack||gem} from internet ..." >            system("gem install  #{pack||gem} --no-ri --no-rdoc")  ; >            require gem >        end Breaks if the user account doesn't have write permissions to the gem installation directory. Also: Who the hell do you think you are that you think you are allowed to futz around with my OS during your script's runtime? What you are doing *screams* malware behaviour (connecting to the internet and downloading code; nobody can guarantee that you haven't done a system("gem sources -a http://malicious.url") somewhere in there). If you are unable or unwilling to bundle your dependencies into one package, that's very much _your_ problem: You can build a custom RubyInstaller for Windows and include your dependencies, and for *NIX you can create a tarball for distribution that includes your dependencies. Heck, the latter works for Windows, too, if you don't include native extensions. -- Phillip Gawlowski gplus.to/phgaw | twitter.com/phgaw A method of solution is perfect if we can forsee from the start, and even prove, that following that method we shall attain our aim.               -- Leibniz