无法使用Python在Heroku教程中启动工头

use*_*662 41 ruby python heroku git-bash foreman

我一直在尝试完成本教程,但遇到了问题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
Run Code Online (Sandbox Code Playgroud)

因此,我尝试通过键入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
Run Code Online (Sandbox Code Playgroud)

我不知道第二组错误试图告诉我什么,因为它似乎声称engine.rb正在运行的文件位置甚至不存在于我的计算机上.

我已经查看了类似问题的其他答案,但是我没有收到类似的错误,所以不相信我的问题的解决方案目前存在.

Eri*_*man 70

我有这个问题.我通过卸载工头宝石的0.62版并安装0.61来修复它.

gem uninstall foreman
gem install foreman -v 0.61
Run Code Online (Sandbox Code Playgroud)

  • 如果你遵循Heroku指南,网站应该运行在127.0.0.1:5000或localhost:5000 (2认同)
  • Heroku不是一个好的用户体验.这是2014年,这个问题没有解决.如果我们无法使用带空格的目录安装它,那就告诉我们.现在,安装工头0.61仍然不适合我,`ImportError:没有名为fcntl的模块'不酷.所以不酷......我想我会使用OSX.我相信经验会有所不同......我希望...... (2认同)

Dmi*_*lov 11

是的,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示例


Eri*_*ode 6

卸载heroku工具带并将其重新安装到一个没有空格的路径中,例如C:\heorku\将有所帮助.除此之外,heroku windows安装程序目前可怕地被破坏,这对我们来说并不是一个值得骄傲的地方.要解决foreman的问题,您可以设置自己使用的环境变量export VAR=VALUE,然后使用您在procfile中输入的命令运行应用程序.

这将在未来有所改善.

  • 路径建议对"错误文件描述符"问题没有帮助. (2认同)