2012-09-06 4 views
6

pdfkit gem이 내 컴퓨터에 성공적으로 설치되었습니다. 그럼 난 gem install wkhtmltopdf-binary을 실행하고 출력이 잘Ruby On Rails : PdfKit 런타임 오류

Successfully installed wkhtmltopdf-binary-0.9.9.1 
1 gem installed 
Installing ri documentation for wkhtmltopdf-binary-0.9.9.1... 
unable to convert "\xC0" from ASCII-8BIT to UTF-8 for bin/wkhtmltopdf_linux_386, skipping 
unable to convert "\xA3" from ASCII-8BIT to UTF-8 for bin/wkhtmltopdf_linux_x64, skipping 
unable to convert "\xCE" from ASCII-8BIT to UTF-8 for bin/wkhtmltopdf_darwin_386, skipping 
Installing RDoc documentation for wkhtmltopdf-binary-0.9.9.1... 
unable to convert "\xC0" from ASCII-8BIT to UTF-8 for bin/wkhtmltopdf_linux_386, skipping 
unable to convert "\xA3" from ASCII-8BIT to UTF-8 for bin/wkhtmltopdf_linux_x64, skipping 
unable to convert "\xCE" from ASCII-8BIT to UTF-8 for bin/wkhtmltopdf_darwin_386, skipping 

한 후 마이 페이지의 PDF 버전에 액세스하려고. 그러나 그것은 또한 런타임 오류 컨트롤러 명 번호가

command failed: "/home/yasir/.rvm/gems/ruby-1.9.3-p194/bin/wkhtmltopdf" "--page-size" "Letter" "--margin-top" "0.75in" "--margin-right" "0.75in" "--margin-bottom" "0.75in" "--margin-left" "0.75in" "--encoding" "UTF-8" "--quiet" "-" "- 

"

답변

1

아래로 pdfkit 구성 파일 (설정/초기화/pdfkit.rb)에 wkhtmltopdf 설치 경로를 추가 보여 나에게 오류를 보여

PDFKit.configure do |config| 
    # Download compatible version of wkhtmltopdf from 'http://wkhtmltopdf.org/downloads.html' 
    # Install it in your system. 
    # Then run 'which wkhtmltopdf' in your terminal to identify the path and update it below 
    config.wkhtmltopdf = '/usr/local/bin/wkhtmltopdf' 
end