> File.open("./lib/rubygems.rb", "w") do |f|
>   f.puts "module Kernel"
>   f.puts "  def require_gem(file, version=nil)"
>   f.puts "    autorequire = %s" % autorequire.inspect
>   f.puts "    file        = autorequire[file]"
>   f.puts "    require(file) unless file.nil?"
>   f.puts "  end"
>   f.puts "end"
> end
   
Resulting in:

 module Kernel
   def require_gem(file, version=nil)
     autorequire = {"activerecord"=>"active_record"}
     file        = autorequire[file]
     require(file) unless file.nil?
   end
 end