Derivatives of Rankin-Selberg L-functions and heights of generalized Heegner cycles