Foreman installed by heroku toolbelt on windows can't be found

坚强是说给别人听的谎言 提交于 2019-11-28 20:26:48

问题


I simply followed the getting started with nodejs tutorial from Heroku. https://devcenter.heroku.com/articles/getting-started-with-nodejs#declare-process-types-with-procfile

But I get an error at the part "declare process types with procfile" My problem is that my cmd (using windows 7) didn't find the command "foreman"

Any solutions ? I downloaded/installed the heroku toolbelt, the login works fine, but foreman dont


回答1:


I had the same problem on Windows7 64-bit, using git's bash. Here's what I did:

  • uninstall the toolbelt, Ruby, and Git using Control Panel's "Program and Features"
  • reinstall the toolbelt to C:\Heroku (see known issue for more info)
  • add C:\Program Files (x86)\git\bin;C:\Heroku\ruby-1.9.2\bin to the system PATH variable: Control Panel, System, Advanced system settings, Environment Variables..., System variables, Variable Path, Edit... (Change ruby-1.9.2 if a future version of the toolbelt includes a newer version of Ruby.)
  • open a git bash window and uninstall foreman version 0.63
    $ gem uninstall foreman
  • then install version 0.61 (see here for more info)
    $ gem install foreman -v 0.61

Now foreman worked for me:
$ foreman start




回答2:


You can do this without uninstall/reinstall:

  1. Open Environment Variables
  2. Add C:\Program Files (x86)\Heroku\ruby-x.x.x\bin to system path (assuming that you installed heroku toolbelt in this directory).
  3. You're done! try it by opening a new shell window and typing foreman start .



回答3:


Foreman finished support for Windows. You can use forego instead. It is a foreman implementation in GO lang.

https://github.com/ddollar/forego




回答4:


Adding C:\Program Files (x86)\Heroku\ruby-1.9.3\bin to the Environment variable PATH worked for me.




回答5:


After installing Heroku toolbelt, I was getting weird errors about required modules when running foreman start. Adding the ruby bin directory to path, and reopening the shell window did not work for me. It seems that foreman was never installed! When I attempted to uninstall foreman, ruby told me it was not installed. So I ran gem install foreman, and 0.77 was installed. One gotcha, I had to open the shell to install the foreman gem as Administrator. Maybe that is how the Heroku toolbelt seems to not have installed properly the first time. Running foreman start seemed to do something after it was installed (naturally).



来源:https://stackoverflow.com/questions/19078939/foreman-installed-by-heroku-toolbelt-on-windows-cant-be-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!