sudo tests were failing under travis because they were not being run as root. this change runs the root tests as root, and chowns the tests' "tmp" directory back to the original user to allow the subsequent 'realworld' tests to pass.
Conflicts: lib/bundler/definition.rb lib/bundler/source.rb spec/bundler/dsl_spec.rb
For implementations like Rubinius that can run from a source directory without installing and which do not overwrite gem binary wrappers in system directories, it is possible to invoke the Rakefile with eg 'rbx -S rake spec' while the system Ruby is on PATH as 'ruby' and 'gem'. This results in the system Ruby running the rake subprocesses instead of Rubinius as intended. These changes use Gem.ruby, which returns the path to the Ruby implementation running rake and use -S to search for the gem bin wrapper on PATH. Rubinius prepends distinguished directories when processing -S so that gems installed into Rubinius are found first. The explicit requiring of rubygems may be controversial. Evan said it was ok but the rest of the changes stand on their own if it's desirable to remove the require.
--- This could produce issues like #1446, where the wrong gem (or no gem) would be found and installed.
…le it first
…a Rubygems checkout