I used the below code that I got from a website and once I executed I just got a disc for a few seconds but the excel application did not open.
require 'win32ole'
excel = WIN32OLE::new('excel.Application')
workbook = excel.Workbooks.Add # create a new workbook
worksheet = workbook.Worksheets.Add