Seriously it is impossible to answer that, it may be good for you or it may not be.
Any I.T. experience you get will stand you in good stead for other I.T. rolls. If I were looking for a Rails Developer I would either want one that was a junior I could train or I would want one on a higher salary that could hit the groung running so a devop with only a little Rails experience might not interest me, however it might make you more employable if however I felt you had a good grounding in others areas that would also prove useful, but as I am not employing you and as I have no idea what the dev ops roll is, or who you are and I have no idea what RoR rolls you are likely to be going for then I can't and shouldn't advise you and anyone who thinks they can either has a crystal ball or is an utter fool.
I have been in the position of needing to hire 20 Delphi Developers, fast! If you had come to me with only a years Delphi experience I would have found you a roll, we drained the market over night. In another organisation I needed 2 Delphi developers but the company would only entertain highly experienced dev's.
You are at the beginning of your I.T. career, it will most likely take you 5 or 6 years to truly understand the rolls you enjoy the most. If you get the Devops job, it might take you longer to get a roll as a Rails Developer or it might not! I could argue that a bird in the hand is worth two in the bush and to suggest you go for it, you never know, you might find that what you end up doing will give you a variety and depth of experience that few other developers ever get and may well stand you in superb position in the future! Or you might hate it! You may get exposure to operating systems that are unusual that may put you in demand and command a higher salary in the future.
As a junior dev I started out on Honeywell Bull main frames running GCOS using tapes (I mean the big reels) when a 1mb HDD was worth £1,500 and we had one of the first 10mb HDD's in the U.K. with clients with budgets of millions and an ICL ticker tape box writing COBOL ANSI 75 apps, I could earn a fortune now with that experience but that was 25 years ago.
What I am trying to say is that there is no such thing as wasted I.T. experience and you must make up your own mind.