The solution from here helped me,we should call it like:
rm -rf ~/Library/Caches/org.carthage.CarthageKit