You can enable it in DevTools Settings > Preferences, under the Elements section.
Update:
Most of them might be confused on how to use it. To use, open console and hover on an element to view the ruler. Thanks @Brandito for mentioning in the comment.
