0

我正在尝试按照这些说明让 premailer gem 工作

我通过将 gemfile 添加到我的文件夹和一个 rake 文件来运行 premailer 来设置我的项目。

我的 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 上发现了这个 bug 已关闭报告,但我不确定这是否是我的问题所在。

知道出了什么问题吗?

4

1 回答 1

0

您在使用 Bundler(即您有 Gemfile)吗?

如果是这样,请尝试添加: gem 'css_parser', '1.2.5'

然后捆绑安装并重试。这将排除 github 问题报告中的问题。

于 2012-05-18T12:54:31.730 回答