1

I'm trying to run foreman inside my GitBash (Windows 7).

I installed it as part of the Heroku-Toolbelt for Windows, and added C:\Program Files (x86)\Heroku\ruby-1.9.3\bin to the path. It works in cmd, but that disrupts my workflow.

The error I get...

$ foreman
sh.exe": /c/PROGRA~2/Heroku/RUBY-1~1.3/bin/foreman: "C:/Program: bad interpreter
: No such file or directory

The issue I find is in the HashBang line inside foreman...

#!"C:/Program Files (x86)/Heroku/ruby-1.9.3/bin/ruby.exe"
#
# This file was generated by RubyGems.
#
# The application 'foreman' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0"

if ARGV.first
  str = ARGV.first
  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
  if str =~ /\A_(.*)_\z/
    version = $1
    ARGV.shift
  end
end

gem 'foreman', version
load Gem.bin_path('foreman', 'foreman', version)

The HashBang line doesn't correctly resolve to the Ruby executable, because of the space in C:/Program Files (x86)/...

I've tried escaping the space with '\', I've tried adding extra "s. I'm at a loss. How do I get that HashBang line to resolve?

PS: First question asked, not sure if I "asked" to StackFlow standards, thanks for any help

Ponelat
  • 116
  • 9

1 Answers1

1

So, I found the answers on StackOverflow - and yes I did look before posting :P

Answer source here: Foreman installed by heroku toolbelt on windows can't be found

My summary:

  1. To get foreman working in GitBash, you have to install heroku-toolbelt in a folder that contains no spaces - I used C:\Heroku

But then an answer to a problem I dan't even encountered yet! For forman to actually work, you have to revert to an older version, v0.61 to be precise**. So...

gem uninstall foreman && gem install foreman -v 0.61

That did the trick, it now works for me! Yay!

**The foreman version that came installed on my heroku-toolbelt was v0.74

Community
  • 1
  • 1
Ponelat
  • 116
  • 9