In this paper, we investigate the formation of narrow planetary rings such as those found around Uranus and Saturn through the tidal disruption of a weak, gravitationally bound satellite that migrates within its Roche limit. Using N-body simulations, we study the behaviour of rubble piles placed on circular orbits at different distances from a central planet. We consider both homogeneous satellites and differentiated bodies containing a denser core. We show that the Roche limit for a rubble pile is closer to the planet than for a fluid body of the same mean density. The Roche limit for a differentiated body is also closer to the planet than for a homogeneous satellite of the same mean density. Within its Roche limit, a homogeneous satellite totally disrupts and forms a narrow ring. The initial stages of the disruption are similar to the evolution of a viscous fluid ellipsoid, which can be computed semi-analytically. On the other hand, when a differentiated satellite is just within the Roche limit only the mantle is disrupted. This process is similar to Roche lobe overflow in interacting binary stars and produces two narrow rings on either side of a remnant satellite. We argue that the Uranian rings, and possibly their shepherd satellites, could have been formed through the tidal disruption of a number of protomoons that were formed inside the corotation radius of Uranus and migrated slowly inwards as a result of tidal interaction with the planet.