Rupee erases morning gains to close marginally weaker