diff --git a/bin/rbpkg b/bin/rbpkg
index 0c38b07..588fe41 100755
--- a/bin/rbpkg
+++ b/bin/rbpkg
@@ -1,13 +1,14 @@
#!/usr/bin/env ruby
require __FILE__ + '/../../lib/rbpkg'
-Rbpkg.init()
-Rbpkg.lock("rbpkg")
-
log_path = Rbpkg.log_path("rbpkg")
+FileUtils.mkdir_p(File.dirname(log_path))
$log = File.open(log_path, "w")
#verbose 2, "Logging to #{log_path}"
+Rbpkg.init()
+Rbpkg.lock("rbpkg")
+
def usage()
STDERR.puts """Usage: #{File.basename($0)} COMMAND REPO ...