diff --git a/lib/ruby_pocket.rb b/lib/ruby_pocket.rb
index <HASH>..<HASH> 100644
--- a/lib/ruby_pocket.rb
+++ b/lib/ruby_pocket.rb
@@ -32,7 +32,7 @@ module RubyPocket
     private
 
     def home_dir
-      Dir.home(Etc.getlogin)
+      Etc.getpwuid.dir
     end
   end
 end
Change RubyPocket#home_dir to more reliably obtain the home directory

Etc.getlogin can fail sometimes.