I use a VOX AmPlug and an iPhone with my electric guitar to do this. For travel I have been thinking of getting one of these
http://www.travelerguitar.com/
or one of these
http://www.miranda-tech.com/
I probably would have already bought a Traveler if they weren't made in China or a Miranda if they weren't so expensive ...
Also, if you are as bad of a player as I am it helps to slow down the song (without changing pitch) with the iPhone app "Music Trainer"