0

これらの指示に従って premailer gem を機能させようとしています

フォルダーに gemfile を追加し、premailer を実行するための rake ファイルを追加して、プロジェクトをセットアップしました。

私の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でこのバグ クローズ レポートを見つけましたが、それが私の問題のルートであるかどうかはわかりません。

何がうまくいかないのですか?

4

1 に答える 1

0

Bundler を使用していますか (つまり、Gemfile を持っていますか)?

もしそうなら、これを追加してみてください: gem 'css_parser', '1.2.5'

次に、バンドルをインストールして、再試行してください。これにより、github issue report の問題が除外されます。

于 2012-05-18T12:54:31.730 に答える