Making the "ruler" go along a perfectly straight line?
The work around would be to :


Press Tab
to Edit go into mode
Hit  N  to open the navigation panel in the 3d viewport
Go to "Mesh Display" section
Turn on Edge info : "Length"


What I usually do is to quickly duplicate a vertex and extrude it to make
an edge. Move the vertex while holding on to CTRL  will move your vertex while
using snap. Make sure your snap tool is set to snap to vertex, closest and also 
turn on snap to self. The edge would have the distance displayed between the 2 vertex with the above options turned on.

This way it makes the ruler tool quite obsolete for measuring straight / linear 
distances.