What is the difference between Ruby and Ruby on Rails?
Ruby is a general purpose language. Ruby on Rails is a Ruby framework for implementing web applications.
Ruby is a programming language. Ruby on Rails ("RoR") is a web-application framework that is implemented in Ruby.
So they not only "work together" but RoR depends on Ruby.