Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/55.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 Ruby on Rails-Dhalang PDF不使用本地主机URL_Ruby On Rails_Pdf_Puppeteer - Fatal编程技术网

Ruby on rails Ruby on Rails-Dhalang PDF不使用本地主机URL

Ruby on rails Ruby on Rails-Dhalang PDF不使用本地主机URL,ruby-on-rails,pdf,puppeteer,Ruby On Rails,Pdf,Puppeteer,因此,我尝试使用dhalang创建PDF,当我在参数中传入google.com时,它工作得非常好,但当我尝试这样做时(控制器): 基本上,我导航到dhalang_test_convert_路径,它应该将dhalang_test_pdf转换为pdf,但我得到一个 导航超时超过50000毫秒 尽管我增加了很多 def dhalang_test_pdf end def dhalang_test_convert _url = request.base_url + dhalang_t

因此,我尝试使用dhalang创建PDF,当我在参数中传入google.com时,它工作得非常好,但当我尝试这样做时(控制器):

基本上,我导航到dhalang_test_convert_路径,它应该将dhalang_test_pdf转换为pdf,但我得到一个

导航超时超过50000毫秒

尽管我增加了很多

  def dhalang_test_pdf
  end

  def dhalang_test_convert
    _url = request.base_url + dhalang_test_pdf_path
    _pdf = Dhalang::PDF.get_from_url(_url, {navigationTimeout: 50000})
    _file_name = "Report" 
    File.open("#{Rails.root}/public/#{_file_name}.pdf", "w+b") << _pdf
    redirect_to "/#{_file_name}.pdf"
  end
<h1>Hello World!!!</h1>
  get "dhalang_test_pdf", to: "pages#dhalang_test_pdf"
  get "dhalang_test_convert", to:"pages#dhalang_test_convert"