You will most likely need administrative privileges to execute the following instructions from the OS command line shell. Use the sudo command (in Unixish systems) or open a cmd.exe window as administrator (in Windows).
ruby -v
gem update --system
gem install rails
gem install sqlite3-ruby
sqlite3 executable is contained somewhere within the PATH environment variable. Windows users can copy the sqlite3.exe and sqlite3.dll files into the Ruby192\bin folder. To see if its correctly installed type:
sqlite3 --version