What problems do you have with rails? Just pop, turn 90 degrees(don't just tweak your legs and have your body still facing forward), land evenly, keep your weight centered in a shoulder-width stance(it helps to try putting a bit more weight on the leading foot to avoid sliding out), and just slide off. When you get the basics you can learn to scissor to properly keep your balance on rails and prepare for spinning off the rail.
Also, if the rail is a ride-on or mild urban lip, put the rail between your legs and then pop and slide. It allows you to continue your direction so you don't have to adjust on the rail.