You're including Msf::Post::File, which has a function named expand_path for same purpose.  I recommend either remove line 18, or you use that function instead :-)