Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/52.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 恶意PDF在OS X上自动失败_Ruby On Rails_Macos_Wicked Pdf - Fatal编程技术网

Ruby on rails 恶意PDF在OS X上自动失败

Ruby on rails 恶意PDF在OS X上自动失败,ruby-on-rails,macos,wicked-pdf,Ruby On Rails,Macos,Wicked Pdf,使用相同的代码和gem版本,它在Ubuntu(14.0464位)中运行良好。目前我正在使用: wkhtmltopdf二进制文件gem v0.9.9.1 wicked_pdfgem v0.10.2 轨道4.1.1 Ruby 2.1.3 OS X 10.10,64位 当我试图从Rails生成PDF时,收到错误消息:wkhtmltopdf\u darwin\u 386意外退出。以下是完整的错误消息: Process: wkhtmltopdf_darwin_386 [12

使用相同的代码和gem版本,它在Ubuntu(14.0464位)中运行良好。目前我正在使用:

  • wkhtmltopdf二进制文件
    gem v0.9.9.1
  • wicked_pdf
    gem v0.10.2
  • 轨道4.1.1
  • Ruby 2.1.3
  • OS X 10.10,64位
当我试图从Rails生成PDF时,收到错误消息:
wkhtmltopdf\u darwin\u 386意外退出
。以下是完整的错误消息:

Process:               wkhtmltopdf_darwin_386 [1208]
Path:                  /Users/USER/*/wkhtmltopdf_darwin_386
Identifier:            wkhtmltopdf_darwin_386
Version:               ???
Code Type:             X86 (Native)
Parent Process:        ruby [1207]
Responsible:           Terminal [560]
User ID:               502

Date/Time:             2014-11-18 13:57:49.082 +0700
OS Version:            Mac OS X 10.10 (14A389)
Report Version:        11
Anonymous UUID:        FE32CAE5-D54C-30C5-5D5E-6B3F12C58027

Sleep/Wake UUID:       83991D0B-AAA7-4EE0-8FF7-5034B78B788F

Time Awake Since Boot: 8000 seconds
Time Since Wake:       1100 seconds

Crashed Thread:        Unknown

Exception Type:        EXC_BAD_ACCESS (SIGBUS)
Exception Codes:       KERN_PROTECTION_FAILURE at 0x0000000000000001

Backtrace not available

Unknown thread crashed with X86 Thread State (32-bit):
  eax: 0x015382c8  ebx: 0x00d8c971  ecx: 0x00000001  edx: 0x00000000
  edi: 0x00000000  esi: 0x015382b4  ebp: 0xbfff6428  esp: 0xbfff6040
   ss: 0x00000023  efl: 0x00010246  eip: 0x00d8e3c2   cs: 0x0000001b
   ds: 0x00000023   es: 0x00000023   fs: 0x00000000   gs: 0x0000000f
  cr2: 0x00000001

Logical CPU:     3
Error Code:      0x00000004
Trap Number:     14


Binary images description not available


External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 1
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 3109
    thread_create: 0
    thread_set_state: 0
我在标题中无声地说的原因是,当我检查服务器日志时,它运行得很好。这里有一段摘录:

"***************\"/Users/david/.rbenv/versions/2.1.3/bin/wkhtmltopdf\" -q  --footer-html \"file:////var/folders/4w/fybp8mln1pn91cqrxq6z2kcc0000gp/T/wicked_footer_pdf20141118-1102-1uce4hg.html\"     --margin-bottom 13    \"file:////var/folders/4w/fybp8mln1pn91cqrxq6z2kcc0000gp/T/wicked_pdf20141118-1102-1jrv3s8.html\" \"/var/folders/4w/fybp8mln1pn91cqrxq6z2kcc0000gp/T/wicked_pdf_generated_file20141118-1102-qu51nc.pdf\" ***************"
  Rendered text template (1.1ms)
Sent data test.pdf (8.4ms)
Completed 200 OK in 6516ms (Views: 7.5ms | ActiveRecord: 6.8ms)
运行wkhtmltopdf为我提供的
/Users/david/.rbenv/shimmes/wkhtmltopdf
。。当我单独运行测试过的wkhtmltopdf时(如
wkhtmltopdf test1.html test1.pdf
),它运行得非常好

是否有可能
wkhtmltopdf\u darwin\u 386
在基于64位的体系结构中工作不好?(尽管我的Ubuntu也是基于64位的。)

非常感谢您的帮助。

您这样做了吗?:

创建/编辑文件:

config/initializers/wicked_pdf.rb

If your wkhtmltopdf executable is not on your webserver's path, you can configure it in an initializer:

WickedPdf.config = {
  :exe_path => '/Users/USER/*/wkhtmltopdf_darwin_386'
}

问题是,wkhtmltopdf执行后意外退出。。这应该意味着找到了可执行文件,但有什么东西导致它退出,对吗?顺便说一句,我刚刚更新了我的问题:)你有没有想过?