Rails is an MVC framework (a methodology for building applications) that was built to work with Ruby.
There are similar (MVC) frameworks that work with PHP and .NET (for example).
And MVC is not restricted to only the web. Development on iOS (in Objective-C) uses a Model-View-Controller paradigm.
Ruby is the development language. Rails is an MVC framework for applications.
If you are interested in learning Web Development, I recommend you learn
Then, perhaps, Ruby and Ruby on Rails