"Ruby for Rails" by David A. Black is a good choice if you're new to Ruby as well as Rails. It spends a lot of time on Ruby fundamentals and only brings in the Rails stuff after having explained the necessary bits of the language so that it actually makes sense. I read the Agile book first, and as a Ruby newbie, it gave me only a very vague understanding of the language. R4R did a much better job of that.