IME with chain off the bar, if you set one leg of a small machinist's square on the bar rails, you can easily see if the rails are even by looking at the other leg of the square. Easy and precise.
To true rails, I use a bench grinder. Set a tool rest so that a bar set on is in line with the center of the wheel. Gently grind the bar until the wheel makes even contact with both rails. Flip it and repeat. Really simple, and the marks from the wheel retain oil. It's worked great for multiple times with circle-cutters.
For prevention, sharpen chain often & avoid debris.
To true rails, I use a bench grinder. Set a tool rest so that a bar set on is in line with the center of the wheel. Gently grind the bar until the wheel makes even contact with both rails. Flip it and repeat. Really simple, and the marks from the wheel retain oil. It's worked great for multiple times with circle-cutters.
For prevention, sharpen chain often & avoid debris.