Sample to get user profile path
suggest change# Home directory. On macOS this is often /Users/username.
# On Windows, HOME may be unset; USERPROFILE is the usual path.
ENV['HOME'] # => "/Users/username"
# Fetch FOO, or "bar" if it is missing. A missing key with no default raises KeyError.
ENV.fetch('FOO', 'bar')
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents