Rails 有关 win32ole 问题

zhurongwell · August 08, 2013 · Last by josh_sulin replied at June 02, 2014 · 3367 hits

报错: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 下面使用啊

You need to Sign in before reply, if you don't have an account, please Sign up first.