【发布时间】:2014-10-05 18:51:34
【问题描述】:
我正在尝试在我的 GitBash (Windows 7) 中运行 foreman。
我将它安装为 Heroku-Toolbelt for Windows 的一部分,并将 C:\Program Files (x86)\Heroku\ruby-1.9.3\bin 添加到路径中。它可以在 cmd 中运行,但这会扰乱我的工作流程。
我得到的错误...
$ foreman
sh.exe": /c/PROGRA~2/Heroku/RUBY-1~1.3/bin/foreman: "C:/Program: bad interpreter
: No such file or directory
我发现的问题是在工头里面的 HashBang 行...
#!"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)
HashBang 行无法正确解析为 Ruby 可执行文件,因为 C:/Program Files (x86)/...
中有空格我试过用 '\' 转义空格,我试过添加额外的 "s。我不知所措。 如何解决 HashBang 行?
PS:问的第一个问题,不确定我是否“询问”了 StackFlow 标准,感谢您的帮助
【问题讨论】:
标签: ruby windows command-line-interface git-bash heroku-toolbelt