久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    • <bdo id='ifN2j'></bdo><ul id='ifN2j'></ul>
  • <small id='ifN2j'></small><noframes id='ifN2j'>

      <tfoot id='ifN2j'></tfoot>

      <legend id='ifN2j'><style id='ifN2j'><dir id='ifN2j'><q id='ifN2j'></q></dir></style></legend>

      1. <i id='ifN2j'><tr id='ifN2j'><dt id='ifN2j'><q id='ifN2j'><span id='ifN2j'><b id='ifN2j'><form id='ifN2j'><ins id='ifN2j'></ins><ul id='ifN2j'></ul><sub id='ifN2j'></sub></form><legend id='ifN2j'></legend><bdo id='ifN2j'><pre id='ifN2j'><center id='ifN2j'></center></pre></bdo></b><th id='ifN2j'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ifN2j'><tfoot id='ifN2j'></tfoot><dl id='ifN2j'><fieldset id='ifN2j'></fieldset></dl></div>

        如何從節(jié)點(diǎn)在 Heroku 上運(yùn)行可執(zhí)行文件,在本地工

        How to run an executable on Heroku from node, works locally(如何從節(jié)點(diǎn)在 Heroku 上運(yùn)行可執(zhí)行文件,在本地工作)
        1. <legend id='BUKe4'><style id='BUKe4'><dir id='BUKe4'><q id='BUKe4'></q></dir></style></legend>
        2. <small id='BUKe4'></small><noframes id='BUKe4'>

              <tbody id='BUKe4'></tbody>
          • <i id='BUKe4'><tr id='BUKe4'><dt id='BUKe4'><q id='BUKe4'><span id='BUKe4'><b id='BUKe4'><form id='BUKe4'><ins id='BUKe4'></ins><ul id='BUKe4'></ul><sub id='BUKe4'></sub></form><legend id='BUKe4'></legend><bdo id='BUKe4'><pre id='BUKe4'><center id='BUKe4'></center></pre></bdo></b><th id='BUKe4'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BUKe4'><tfoot id='BUKe4'></tfoot><dl id='BUKe4'><fieldset id='BUKe4'></fieldset></dl></div>
            <tfoot id='BUKe4'></tfoot>

              • <bdo id='BUKe4'></bdo><ul id='BUKe4'></ul>

                  本文介紹了如何從節(jié)點(diǎn)在 Heroku 上運(yùn)行可執(zhí)行文件,在本地工作的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  這是我的第一個(gè) SE 問題.通常我可以通過這個(gè)很棒的網(wǎng)站很容易地找到任何問題的答案,但不幸的是,在這種情況下,無論是在這里還是在其他地方,我都找不到任何我正在尋找的東西.讓我解釋一下問題:

                  This is my first SE question. Usually I can find an answer to anything fairly easily through this great website, but unfortunately on this occasion I can't find anything on what I am looking for, either here or elsewhere. Let me explain the problem:

                  我編寫了一個(gè) C++ 程序來進(jìn)行一些數(shù)值計(jì)算.它接受命令行參數(shù)并寫入標(biāo)準(zhǔn)輸出,并且在我運(yùn)行 OSX 的系統(tǒng)上運(yùn)行良好.

                  I have written a C++ program to do some numerical computations. It takes command line arguments and writes to stdout and works fine on my system running OSX.

                  我想在線托管它,讓我的同行更輕松地試用它,因此我編寫了一些 Node.js 和 Express 代碼來從表單中獲取輸入并將其作為命令行參數(shù)提供給可執(zhí)行文件.然后我按以下方式執(zhí)行名為factoriser"的二進(jìn)制文件:

                  I want to host this online for my peers to try it out more easily, and so I wrote some Node.js and Express code to take an input from a form and give that as a command line argument to the executable. I then execute the binary called 'factoriser' in the following way:

                  const exec = require('child_process').exec;
                  app.post('/', function (req, res) {
                      var input = req.body.numberinput; //Number entered on the webpage
                  
                      const child = exec('./numericcomp ' + input, {timeout: 20000}, function(error, stdout, stderr) {
                          //Code here writes stdout to the page
                      }
                  }
                  

                  以上在我的本地機(jī)器上完美運(yùn)行,但是當(dāng)我將它部署到 Heroku 然后嘗試輸入時(shí)(這里我嘗試了 2131),我得到一個(gè)錯(cuò)誤:

                  The above works perfectly on my local machine but when I deploy it to Heroku and then try an input (here I tried 2131) I get an error of:

                  Error: Command failed: ./numericcomp 2131 ./numericcomp: 3: ./numericcomp: Syntax error: word unexpected (expecting ")")
                  

                  給 exec 中的回調(diào)函數(shù).

                  that is given to the callback in exec.

                  所以我真的不知道該怎么辦,問題是 Heroku 沒有正確運(yùn)行可執(zhí)行文件.我對(duì) Heroku 的工作原理不是特別了解,我已經(jīng)閱讀了有關(guān) buildpack 等的信息,但僅執(zhí)行二進(jìn)制文件似乎是一個(gè)非常復(fù)雜的過程.是不是因?yàn)槲抑挥幸粋€(gè)dyno,不能運(yùn)行子進(jìn)程?

                  So I really don't know what to do, the issue is that Heroku just isn't running the executable properly. I am not particularly knowledgable about how Heroku works, I have read through info on buildpacks etc. but it seems a very complicated process just to execute a binary. Is it because I only have one dyno and it can't run the child process?

                  如果有人能在這里為我指明正確的方向,我將不勝感激,看來我已經(jīng)完成了所有的努力,但無法克服最后的障礙.

                  I would be very grateful if someone could point me in the right direction here, it seems I have done all the hard work but can't get over the final hurdle.

                  推薦答案

                  好的,我已經(jīng)開始工作了,很多人可能對(duì)此感興趣,所以我會(huì)發(fā)布我是如何做到的.

                  Ok, I have got it to work, this may be of interest to many so I will post how I did it.

                  問題是 Heroku 的架構(gòu)與我機(jī)器上的架構(gòu)不同,因此編譯后的程序根本無法在 Heroku 上運(yùn)行.為了解決這個(gè)問題,我創(chuàng)建了一個(gè) makefile 來編譯 C++ 源代碼并使用

                  The problem was that Heroku's architecture is not the same as that on my machine and hence the compiled program simply would not run on Heroku. To get around this I created a makefile to compile the C++ source code and pushed this to Heroku using

                  $ git push heroku master
                  

                  然后

                  $ heroku run bash
                  

                  它實(shí)質(zhì)上設(shè)置了一個(gè)可以訪問您的 Heroku 實(shí)例的 bash shell.

                  which essentially sets up a bash shell with access to your Heroku instance.

                  從這里,使用

                  $ make
                  

                  然后scp這個(gè)可執(zhí)行文件回到你的本地機(jī)器然后

                  Then scp this executable back to your local machine and then

                  $ git add .
                  $ git commit -m "added working executable"
                  

                  $ git push heroku master
                  

                  然后運(yùn)行的可執(zhí)行文件將在 Heroku 應(yīng)用程序中,并且將像在本地主機(jī)上一樣運(yùn)行.

                  Then the working executable will be there on the Heroku app and will run just like on local host.

                  這篇關(guān)于如何從節(jié)點(diǎn)在 Heroku 上運(yùn)行可執(zhí)行文件,在本地工作的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當(dāng)沒有異常時(shí),C++ 異常會(huì)以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對(duì) const 的引用?)
                  When and how should I use exception handling?(我應(yīng)該何時(shí)以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對(duì)象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構(gòu)造函數(shù)的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區(qū)別)
                      <bdo id='nuvoP'></bdo><ul id='nuvoP'></ul>

                        <tfoot id='nuvoP'></tfoot>

                            <i id='nuvoP'><tr id='nuvoP'><dt id='nuvoP'><q id='nuvoP'><span id='nuvoP'><b id='nuvoP'><form id='nuvoP'><ins id='nuvoP'></ins><ul id='nuvoP'></ul><sub id='nuvoP'></sub></form><legend id='nuvoP'></legend><bdo id='nuvoP'><pre id='nuvoP'><center id='nuvoP'></center></pre></bdo></b><th id='nuvoP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='nuvoP'><tfoot id='nuvoP'></tfoot><dl id='nuvoP'><fieldset id='nuvoP'></fieldset></dl></div>
                          • <legend id='nuvoP'><style id='nuvoP'><dir id='nuvoP'><q id='nuvoP'></q></dir></style></legend>
                          • <small id='nuvoP'></small><noframes id='nuvoP'>

                              <tbody id='nuvoP'></tbody>
                          • 主站蜘蛛池模板: 久久国产免费 | 久久精品无码一区二区三区 | 国产一级大片 | 九九热免费视频在线观看 | 中文字幕国产高清 | av网站免费观看 | 欧美不卡 | 欧美日本韩国一区二区三区 | 精品久久久久久国产 | 午夜精品一区 | 国产一区二区在线免费观看 | 亚洲日本一区二区 | 九九热re | 日韩欧美在线一区 | 日韩在线中文 | 欧美福利网站 | 91在线电影| 狠狠操网站 | 欧美精品一区二区三区在线播放 | 欧美激情a∨在线视频播放 成人免费共享视频 | 超碰在线免费 | 日韩区| 日本一区二区影视 | 丝袜天堂 | 中文字幕一区二区三区精彩视频 | 国产精品久久久久久久久久久久冷 | 狠狠操电影| 亚洲黄色国产 | 嫩草视频网站 | 欧美视频在线播放 | 国产精品久久久久婷婷二区次 | 91精品国产综合久久精品图片 | 玖玖视频国产 | 久在线| 日韩在线视频一区 | 国产一区二区三区在线看 | 久久久久久久综合色一本 | 国产一级片在线播放 | 久久亚洲一区二区 | 亚洲大片一区 | 7777在线视频 |