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

2024-06-06 19:13:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我一直试图完成this tutorial,但是遇到了foreman start行的问题。我正在使用一台Windows7,64位的机器,并试图在Heroku工具带提供的GitBash终端中完成这项工作。

当我输入foreman start时,收到:

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

所以我尝试在git bash中输入cmd,方法是键入cmd,然后使用foreman start(类似于a comment on one of the answers to this question建议)。这就是为什么:

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正在运行的文件位置在我的计算机上甚至不存在。

我已经看了类似问题的其他答案,但是我没有收到类似的错误,因此不认为我的问题的解决方案目前存在。


Tags: ingemscmdherokulibfilesforemanthis
3条回答

是的,heroku工具带安装程序目前工作不正常(2013年8月30日)。 对于windows,以下步骤对我有效:

  1. 卸载heroku(通过windows“程序卸载”)
  2. 将heroku https://toolbelt.heroku.com/windows安装到C:\bin\heroku中,即“没有空格”
  3. http://rubyinstaller.org/downloads/安装ruby
  4. 在命令行中运行“gem install foreman-v 0.61”。是的,“gem install foreman”安装了v0.63,这不适用于“foreman start”
  5. 在cmd中,“foreman start”用于heroku hello world示例

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

这在未来会有所改善。

我有这个问题。我通过卸载foreman gem的0.62版本并安装0.61来修复它。

gem uninstall foreman
gem install foreman -v 0.61

相关问题 更多 >