问题
I am trying to run foreman on heroku. This is a common error, however, i still didnt find a solution. It is clearly missing a path here:
"/c/Program Files/ruby-1.9.2/bin/foreman: "C:/Program: bad interpreter: no such file or directory
My question is: is there a way to avoid this error by manually adding the whole path? Or where should I look to change it? Thank you.
回答1:
This is a known issue with running foreman in Git bash shell on windows enviroment. (See github issue)
The only current workaround is running foreman in another environment, like Windows cmd prompt or powershell.
回答2:
After reading knut's answer to this question, I fixed this problem on my system by re-installing Heroku Toolbelt to c:\heroku. After re-installation, the heroku command worked, but foreman would not run. I fixed this by manually adding the following to my system path.
C:\heroku\ruby-1.9.2\bin
You'll likely need to search for the foreman program to get the version of the above path that's correct for your system.
I also needed to replace foreman version 0.62 with 0.61, which I learned from this post.
回答3:
I don't know foreman, but I know this problem from other gems. Perhaps the following works:
Don't install ruby (resp. foreman) in c:\Program Files\...
, use a installation path without spaces.
My ruby installation is in a path without spaces and when I start foreman, foreman is executed (and stops with a error ([...]lib/foreman/process.rb:54:in spawn': Exec format error - ./spawner (Errno::ENOEXEC)
- but I think that's a problem of my test data).
Background:
Anywhere a script is called with a parameter c:\Program Files\...
, but windows takes it as two parameters c:\Program
and Files\...
.
Normally you can mask the parameters in "
, but I found no place where the problem occurs - sorry.
来源:https://stackoverflow.com/questions/14157917/foreman-start-with-a-manual-path