I did a fair amount of work on import scripts before I read Programming Ruby. It did help quite a bit. I think that’s also the same Rails book I read. I don’t think it’ll hurt.
That said, depending on what it is you’re trying to do, you can get pretty far by just finding some examples to follow. You can grep GitHub - discourse/all-the-plugins · GitHub and find lots of examples.
And understanding rails definitely helps, but knowing that you can call add_to_serializer to add stuff to the serializer is something that you won’t find in a book (or at least any book I know of).