If you forget to check the path box while installing ruby (assuming you installed ruby using rubyinstaller or railsinstaller), just add the ruby bin path to the PATH enviromental variable. Open command prompt and run following:
setx PATH "%PATH%;C:\Ruby22-x64\bin\\"
echo %PATH% to check if it was added correctly.
You can add it by opening My Computer > Properties > Advanced system settings > Advanced > Environmental Variables, under "User variables", double click PATH, then add your ruby bin path, make sure paths are separated by a ";" (
;C:\Ruby22-x64\bin\\ in my case)