Like over people have said, learn it on flat ground or a kerb, to get the motions down, then move onto something bigger. People say rails is the hardest, it is in the sense of accuracy but once your wheel has switched (so your rear wheel is now on the rail), you don't have to hold on the rear wheel, you can just release the brake and kick the pedals. Rather than switching on a large ledge, you have to hold it on the rear wheel to avoid the front end dropping (which on some ledges can be a big drop on the other side.