While getting the current user's home directory is easy enough for the current user if you're willing to rely on ENV['USERPROFILE'], obtaining the home directory of an arbitrary local user isn't so straightforward. Here's the solution:
require 'win32/security'
require 'win32/registry'
key = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\"
usr = 'some_user'
sec = Win32::Security::SID.open(usr)
key += sec.to_s
Win32::Registry::HKEY_LOCAL_MACHINE.open(key) do |reg|
p reg['ProfileImagePath']
end