【问题标题】:git trouble deploying sinatra application with herokugit 使用 heroku 部署 sinatra 应用程序时遇到问题
【发布时间】:2011-08-30 07:35:38
【问题描述】:

我刚刚开始研究这些东西,因此欢迎和感谢任何帮助。提前致谢!

我编写了一个 Sinatra 应用程序并部署到 Heroku,但某处存在错误。运行某些 heroku 命令,如 heroku open 或 heroku logs 会响应以下错误(此处显示为“heroku logs”)。我已经安装了 Git Bash 和一个 git gem,但是在命令行中使用 git 不起作用。

C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/helpers.rb:111:in ``
': 没有这样的文件或目录 - git --version (Errno::ENOENT)
        来自 C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/helpers
.rb:111:in `has_git?'
        来自 C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/helpers
.rb:116:in `git'
        来自 C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/command
/base.rb:188:in `git_remotes'
        来自 C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/command
/base.rb:166:in `extract_app_in_dir'
        来自 C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/command
/base.rb:158:in `extract_app'
        来自 C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/command
/base.rb:210:在“应用程序”中
        来自 C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/command
/logs.rb:30:in `index'
        来自 C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/command
.rb:117:在“运行”中
        来自 C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/bin/heroku:14:in `
'
        来自 C:/Ruby192/bin/heroku:19:in `load'
        来自 C:/Ruby192/bin/heroku:19:in 'main>'

【问题讨论】:

  • 您是否尝试过从 git bash 而不是命令提示符运行此命令?
  • 我刚才试了下,还是不行。我认为 Git 对 Heroku gem 一无所知
  • 您运行了 Git Bash,并从它的提示符中执行了 git --version,但它不起作用?错误信息是什么?
  • @olivier - 应该正确安装 Git Bash。我已经通过运行 git --version 安装了 1.7.4 版。我的主要问题是让 heroku 识别 git,因为这似乎是我收到的错误的根源

标签: git heroku sinatra datamapper


【解决方案1】:

当您安装 msysgit 时,您可能选择了“仅 Git Bash”选项,这会阻止您从命令行运行 git(这是应用程序正在尝试执行的操作)。 Look here for a proper installation walkthrough.

您需要将 msysgit 路径添加到PATH 环境变量。 Look here for instructions.

【讨论】:

  • 感谢您的帮助,奥利维尔。抱歉,您能告诉我有关添加 msysgit 路径的更多详细信息吗?我应该完全按照您发送给我的链接进行操作还是作为示例?
  • 根据安装指南,默认安装路径为C:\Program Files\Git。如果那是您安装 msysgit 的位置,则必须按照第二个链接的说明将 C:\Program Files\Git\bin 添加到您的 PATH 变量中。 (你基本上必须告诉 Windows 在哪里可以找到 Git。)
  • 非常感谢。得到它的工作。感谢您的时间和及时的回复
  • @dchang:不客气。我不知道我的答案与实际解决方案有多接近,但习惯上接受解决您问题的答案。 (如果解决方案完全是另外一回事,请继续回答您自己的问题并接受您自己的答案。)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-08-27
  • 1970-01-01
  • 2017-05-03
  • 2021-04-21
  • 2011-05-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多