繁体   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