homepath = Pathname.new(ENV['HOME'])

Would be my guess.