4

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.

user1743703
  • 133
  • 2
  • 10

3 Answers3

4

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.

quandrum
  • 1,608
  • 1
  • 11
  • 14
  • Could you add the exact command you are running? It's not clear what you're actually trying to do. – quandrum Jan 04 '13 at 15:16
  • I'm going to take a wild stab and say you are running this through the Git bash window. This is a known error for foreman: https://github.com/ddollar/foreman/issues/166 with no work around (besides not running it in git bash on windows) – quandrum Jan 04 '13 at 15:45
  • 1
    Excuse me, kind sir, but how do I run it then? – user1743703 Jan 04 '13 at 15:53
  • Windows command line seems to be the only place people have gotten foreman to run. (Start menu => run => enter "cmd.exe") – quandrum Jan 04 '13 at 15:57
  • Thank you very much, it's a shame I didn't try it earlier! – user1743703 Jan 04 '13 at 16:02
  • 1
    I'm convinced now that there is a conspiracy between Microsoft and all creators of development tools to make web development on Windows as hard and frustrating as humanly possible. I'm on my 4th different shell trying to get Heroku to work. – Jer May 31 '14 at 22:55
4

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.

Community
  • 1
  • 1
csusbdt
  • 96
  • 7
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.

knut
  • 27,320
  • 6
  • 84
  • 112