Hey Gitanjali, to setup Selenium with Ruby you first need to install Ruby on your system. Now if you are using Windows, you can simply use the RubyInstaller Package. For MacOS, use Homebrew Package Manager to install Ruby using following command:
brew install ruby
Now to install Selenium Webdriver, use following command:
gem install selenium-webdriver
You can also install unit-test package to write unit-tests:
gem install test-unit