How to create an Excel sheet with spreadsheet gem.

Shekhar Patil
Feb 21, 2020

We can create an Excel sheet using the following few steps in the rails application.

Add spreadsheet gem to the gemfile as the following:

gem ‘spreadsheet’

Then use bundle install command to install this spreadsheet.

Open the rails console and execute the following code.

Our test.xls Excel file is created in the root folder of the project directory.

Learn more about spreadsheet gem from the following link:

Visit MGR Software, for more interesting blogs. Thank you!

--

--