小弟在一个 ACTION 里面加了一段读取 EXCEL 的代码如下 require 'win32ole'
WIN32OLE.codepage = WIN32OLE::CP_UTF8 excel = WIN32OLE::new('EXCEL.APPLICATION') workbook = excel.Workbooks.Open('E:/lib/deploy.xlsx') worksheet = workbook.Worksheets(1) worksheet.Select …… workbook.close excel.Quit 省略号部分是是读取 EXCEL 中的内容。 问题是,发送请求之后只能显示一次,之后再刷新就报如下错误: WIN32OLERuntimeError in InstancesController#read_deploy
failed to create WIN32OLE object from `EXCEL.APPLICATION' HRESULT error code:0x800401f0 CoInitialize has not been called.
请问是怎么回事,如何解决