It's been a while now, but I really liked Eloquent Ruby.
If you're looking for Rails-specific knowledge, the Hartl tutorial (I think it's just called Rails Tutorial) is fantastic. There's a print version, but the web one is free (at least when I read it) and stays updated.