I'm trying to import a shared (to everyone) Google spreadsheet into my database in Rails, using Roo. The following code:
url = 'https://docs.google.com/spreadsheets/d/1-4kCLEXRcIlJB1wK5muZWsIL1nz5NsEWXyLrbe_HJNQ/edit?usp=sharing'
xls = Roo::Spreadsheet.open(url)
gives me
undefined method `spreadsheet_by_key' for nil:NilClass" error message.
Could you suggest what am I doing wrong? What is the easiest way to import a shared Google spreadsheet in Rails?
You are trying to import the edit url. Use the export xlsx link and try to import that using roo. And you might also need to specify the extension via extension option.