diff --git a/lib/fog/core/credentials.rb b/lib/fog/core/credentials.rb index 2ce005d1d..ba0546781 100644 --- a/lib/fog/core/credentials.rb +++ b/lib/fog/core/credentials.rb @@ -19,7 +19,7 @@ module Fog # @return [String] The path for configuration_file def self.credentials_path @credential_path ||= begin - path = ENV["FOG_RC"] || (ENV['HOME'] && '~/.fog') + path = ENV["FOG_RC"] || (ENV['HOME'] && File.directory?(ENV['HOME']) && '~/.fog') File.expand_path(path) if path end end