我对Ruby一无所知:)
问题是,我需要一种将 HTML 电子邮件中的所有 CSS 转换为内联样式的方法。没有比使用Alex Dunae 的 Premailer更好的方法了。
但我想在 Windows 上运行它。我的目标是能够从 C# 运行脚本,并获取由 C# 中的 ruby 脚本创建的文件,并将 HTML 用于电子邮件。
无论如何,运行 ruby 脚本对我来说是困难的部分。我已经下载并安装了Ruby Installer,并且还下载了 Premailer 1.6.2 包。
我尝试这样做:
C:\Ruby192\bin>ruby.exe C:\Workspace\Premailer\bin\premailer C:\Workspace\index.htm > C:\Workspace\index2.htm
它告诉我的是:
C:\Ruby192\bin>ruby.exe C:\Workspace\Premailer\bin\premailer C:\Workspace\index.htm > C:\Workspace\index2.htm
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- hpricot (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from C:/Workspace/Premailer/lib/premailer.rb:4:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from C:/Workspace/Premailer/bin/premailer:5:in `<main>'
我可能需要一些依赖项,还是什么?