我正在尝试按照这些说明让预邮件 gem 工作
我已经通过向我的文件夹添加一个 gemfile 和一个 rake 文件来运行预邮件程序来设置我的项目。
我的耙子文件看起来像这样 -
task :default do
require 'premailer'
premailer = Premailer.new('email_source.html', :warn_level => Premailer::Warnings::SAFE)
# Write the HTML output
fout = File.open("output.html", "w")
fout.puts premailer.to_inline_css
fout.close
# Write the plain-text output
fout = File.open("ouput.txt", "w")
fout.puts premailer.to_plain_text
fout.close
# Output any CSS warnings
premailer.warnings.each do |w|
puts "#{w[:message]} (#{w[:level]}) may not render properly in #{w[:clients]}"
end
end
我收到以下错误 -
undefined method `create_border_shorthand!' for #<CssParser::RuleSet:0x00000101533278>
我在 github 上找到了这个错误关闭的报告,但我不确定这是否是我问题的途径。
知道出了什么问题吗?
您是否正在使用捆绑器(即您有宝石文件)?
如果是这样,请尝试添加以下内容:宝石 "css_parser"、"1.2.5"
然后捆绑安装并重试。这将排除github问题报告中的问题。