【发布时间】:2012-05-11 21:34:14
【问题描述】:
当我当时使用 win32ole 作为独立应用程序时,一切似乎都运行良好,一旦我放入运行在 mongrel 服务器上的 rails 应用程序,它就会进入无限循环。
我正在尝试访问“https://microsoft/sharepoint/document.doc”
def generatertm(issue)
begin
word = WIN32OLE.new('word.application')
logger.debug("Word Initialized...")
word.visible = true
myDocLink = "https://microsoft/sharepoint/url.doc"
myFile = word.documents.open(myDocLink)
logger.debug("File Opened...")
puts "Started Reading bookmarks..."
myBookMarks = myFile.Bookmarks puts "bookmarks fetched working background task..."
print ("Bookmakr Count : " + myBookMarks.Count.to_s + "\n")
myBookMarks.each do |i|
logger.warn ("Bookmark Name : " + i.Name + "\n")
end
rescue WIN32OLERuntimeError => e
puts e.message
puts e.backtrace.inspect
else
ensure
word.activedocument.close( true ) # presents save dialog box
#word.activedocument.close(false) # no save dialog, just close it
word.quit
end
end
当我当时单独运行此代码时,会弹出一个弹出窗口以获取 Microsoft 共享点凭据。但是在 mongrel rails 中它会进入无限循环。
我是否需要处理此弹出窗口才能通过 Rails 显示?
【问题讨论】:
-
进度 - 当我进入 Windows 环境中的“服务”时 - 在 Mongrel 服务属性中,“登录 -> 允许与桌面交互”中有一个选项当我检查它并尝试运行我的我得到的代码“交互式服务检测 - 此计算机上运行的程序正在尝试显示消息 [内容] 该程序可能需要您或您的许可才能完成任务。为什么会发生这种情况?[V] 显示程序详细信息 [查看消息] [稍后问我]" 那么如何在浏览器而不是在后台获取此服务提示?我的方向正确吗?
标签: ruby-on-rails windows-services mongrel win32ole mongrel-cluster