2011-05-21 155 views
0

我剛剛進入這個東西,所以任何幫助,歡迎和讚賞。提前致謝!git使用heroku部署sinatra應用程序時遇到問題

我已經寫了一個Sinatra應用程序並部署到Heroku,但是在某處存在一個錯誤。運行某些heroku命令(如heroku open或heroku日誌)會響應下面的錯誤(這裏顯示爲'heroku日誌')。我已經安裝了Git Bash和一個git gem,但是在命令行中使用git不起作用。

C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/helpers.rb:111:in `` 
': No such file or directory - git --version (Errno::ENOENT) 
     from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/helpers 
.rb:111:in `has_git?' 
     from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/helpers 
.rb:116:in `git' 
     from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/command 
/base.rb:188:in `git_remotes' 
     from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/command 
/base.rb:166:in `extract_app_in_dir' 
     from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/command 
/base.rb:158:in `extract_app' 
     from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/command 
/base.rb:210:in `app' 
     from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/command 
/logs.rb:30:in `index' 
     from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/lib/heroku/command 
.rb:117:in `run' 
     from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.1.3/bin/heroku:14:in ` 
' 
     from C:/Ruby192/bin/heroku:19:in `load' 
     from C:/Ruby192/bin/heroku:19:in 'main>'
+0

你有沒有試過從git bash而不是命令提示符運行這個命令? – hwrdprkns 2011-05-21 17:56:27

+0

我剛纔嘗試過,但沒有奏效。我不認爲Git知道任何關於Heroku的寶石 – dchang 2011-05-21 18:22:01

+0

你跑了Git Bash,從它的提示你做了'git --version',它不起作用?錯誤信息是什麼? – 2011-05-21 18:45:24

回答

3

當你安裝msysgit,你可能選擇了「唯一的Git打擊」選項,這樣可以阻止用戶在命令行中運行git(這是什麼應用程序正在試圖做的)。 Look here for a proper installation walkthrough.

您需要將msysgit路徑添加到PATH環境變量中。 Look here for instructions.

+0

感謝您的幫助Olivier。對不起,你能給我更多關於添加msysgit路徑的細​​節嗎?我是否應該完全遵循你發給我的鏈接或者是一個例子? – dchang 2011-05-21 18:26:00

+0

根據安裝指南,默認安裝路徑是'C:\ Program Files \ Git'。如果這是你安裝msysgit的地方,那麼你必須按照第二個鏈接的說明在你的'PATH'變量中添加'C:\ Program Files \ Git \ bin'。 (你基本上必須告訴Windows在哪裏可以找到Git。) – 2011-05-21 18:38:28

+0

非常感謝。得到它的工作。感謝您的時間和及時回覆 – dchang 2011-05-22 22:57:01

相關問題