我正在尝试通过关注these instructions来让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>我找到了这个bug closed report on github,但我不确定这是否是我问题的解决途径。
知道哪里出问题了吗?
发布于 2012-05-18 20:54:32
您是否在使用Bundler (即你有Gemfile吗)?
如果是这样,尝试添加这个: gem 'css_parser','1.2.5‘
然后捆绑安装,然后重试。这将排除github问题报告中的问题。
https://stackoverflow.com/questions/10502409
复制相似问题