Buildr depends on several Gems that install executables (rake, spec, etc). It is a good idea to not have write permission on directories containing executables (part of the security architecture of Unix and its derivatives). For the general case you need to use sudo to install Buildr and its dependencies, it might be annoying, but it's keeping to the security architecture.
That should be the default behavior. Also, avoid using 'or' and 'and' in expression (they're fine as statement separators). 99% of the time they work just like && and ||, but every once in a while they're used without paying attention to operator precedence and we end up with subtle and hard to find bugs. Assaf On Mon, Jun 15, 2009 at 11:14 AM, <djspie...@apache.org> wrote: > Author: djspiewak > Date: Mon Jun 15 18:14:37 2009 > New Revision: 784896 > > URL: http://svn.apache.org/viewvc?rev=784896&view=rev > Log: > Added RAKE_SUDO envar override (for e.g. non-global JRuby installations) > > Modified: > buildr/trunk/rakelib/setup.rake > > Modified: buildr/trunk/rakelib/setup.rake > URL: > http://svn.apache.org/viewvc/buildr/trunk/rakelib/setup.rake?rev=784896&r1=784895&r2=784896&view=diff > > ============================================================================== > --- buildr/trunk/rakelib/setup.rake (original) > +++ buildr/trunk/rakelib/setup.rake Mon Jun 15 18:14:37 2009 > @@ -17,6 +17,12 @@ > require 'jruby' if RUBY_PLATFORM[/java/] > require 'rubygems/source_info_cache' > > +RAKE_SUDO = case (ENV['RAKE_SUDO'] or 'yes').strip.downcase > + when 'yes', 'true' > + true > + else > + false > +end > > # Install the specified gem. Options include: > # - :version -- Version requirement, e.g. '1.2' or '~> 1.2' > @@ -27,7 +33,7 @@ > puts "Installing #{name} ..." > rb_bin = File.join(Config::CONFIG['bindir'], > Config::CONFIG['ruby_install_name']) > args = [] > - args << 'sudo' << 'env' << "JAVA_HOME=#{ENV['JAVA_HOME']}" if > sudo_needed? > + args << 'sudo' << 'env' << "JAVA_HOME=#{ENV['JAVA_HOME']}" if > sudo_needed? and RAKE_SUDO > args << rb_bin << '-S' << 'gem' << 'install' << name > args << '--version' << dep.version_requirements.to_s > args << '--source' << options[:source] if options[:source] > > >