簡體   English   中英

無法使用Python在Heroku教程中啟動工頭

[英]Can't start foreman in Heroku Tutorial using Python

我一直試圖完成本教程 ,但遇到了foreman start線的問題。 我正在使用Windows 7,64位機器,我試圖在Heroku Toolbelt提供的git bash終端中執行此操作。

當我進入foreman start我收到:

sh.exe": /c/Program Files (x86)/Heroku/ruby-1.9.2/bin/foreman: "c:/Program: bad
interpreter: No such file or directory

因此,我嘗試通過鍵入cmd然后使用foreman start來輸入git bash中的cmd (類似於對此問題的答案之一的評論 )。 這就是產生的:

Bad file descriptor
c:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/foreman-0.62.0
/lib/foreman/engine.rb:377:in `read_nonblock'
c:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/foreman-0.62.0
/lib/foreman/engine.rb:377:in `block (2 levels) in watch_for_output'
c:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/foreman-0.62.0
/lib/foreman/engine.rb:373:in `loop'
c:/Program Files (x86)/Heroku/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/foreman-0.62.0
/lib/foreman/engine.rb:373:in `block in watch_for_output'
21:06:08 web.1  | exited with code 1
21:06:08 system | sending SIGKILL to all processes

我不知道第二組錯誤試圖告訴我什么,因為它似乎聲稱engine.rb運行的文件位置甚至不存在於我的計算機上。

我已經查看了類似問題的其他答案,但是我沒有收到類似的錯誤,所以不相信我的問題的解決方案目前存在。

我有這個問題。 我通過卸載工頭寶石的0.62版並安裝0.61來修復它。

gem uninstall foreman
gem install foreman -v 0.61

是的,heroku-toolbelt-installer目前無法正常工作(2013年8月30日)。 對於Windows,以下步驟適用於我:

  1. 卸載heroku(通過windows'程序卸載')
  2. 將heroku https://toolbelt.heroku.com/windows安裝到C:\\ bin \\ heroku中,即'no spaces'
  3. http://rubyinstaller.org/downloads/安裝ruby
  4. 在cmd中運行“gem install foreman -v 0.61”。 是的,“gem install foreman”安裝了v0.63,這對“工頭啟動”不起作用
  5. 在cmd“foreman start”適用於heroku hello-world示例

卸載heroku工具帶並將其重新安裝到一個沒有空格的路徑中,例如C:\\heorku\\會有所幫助。 除此之外,heroku windows安裝程序目前可怕地被破壞,這對我們來說並不是一個值得驕傲的地方。 要解決foreman的問題,您可以使用export VAR=VALUE設置環境變量,然后使用您在procfile中輸入的命令運行應用程序。

這將在未來有所改善。

要添加的一件事是,如果您將Heroku安裝到帶空格的目錄中,那么當您嘗試執行gem install foreman -v 0.61 (在Windows上)時也會導致錯誤。

一旦我將Heroku重新安裝到C:\\ Heroku而不是C:\\ Program Files \\ Heroku,那么我就可以使用上面的Eric Speelman的解決方案來完成這項工作了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM