Actually, this is not quite correct.
The word ‘путь’ historically was masculine, but masculine nouns ending with ‘ь’ used to have two different declension paradigms. Later, the words of the second paradigm moved to feminine (since that second paradigm was pretty alike with the one for feminine nouns), but the word ‘путь’ didn't, being the only word using that paradigm now. In some dialects, however, it did.