Rails 有关 win32ole 问题

zhurongwell · 2013年08月08日 · 最后由 josh_sulin 回复于 2014年06月02日 · 3362 次阅读

报错:failed to create WIN32OLE object from `Word.Application' HRESULT error code:0x800401f0

代码:require 'win32ole' word = WIN32OLE.new('Word.Application') word.visible=true #是否打开文件 word.Documents.Add() for i in(0..100) word.Selection.Font.Size=12 word.Selection.Font.ColorIndex = 2 word.Selection.TypeText("Word with Ruby \n") end word.DefaultSaveFormat word.Documents.close()

没装 word?

@zhurongwell @ywjno 我在 linux 下面 require 'win32ole' 直接就报 LoadError: cannot load such file -- win32ole,是不是这个标准库 (win32ole),不能在 linux 下面使用啊

需要 登录 后方可回复, 如果你还没有账号请 注册新账号