![](/img/trans.png)
[英]Capistrano DigitalOcean Ubuntu 14.04 fatal: Not a git repository (or any of the parent directories) .git
[英]fatal: Not a git repository (or any of the parent directories): .git on every rails command but git commands works fine
我遇到了git和我的rails項目的問題。
我已經建立了一個github存儲庫並成功推送了四個提交。 我正在嘗試的每個git命令都按預期工作( git status, git add, git commit, git push
等)。 但每次我嘗試執行rails命令(例如bundle show, bundle install, rails s, rails generate, rake test
等)時,我在控制台中收到以下消息:
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
每次消息出現在三行上。 有時候六行。 .git
文件夾在我的項目中,我在正確的文件夾中。 所有rails命令都按預期工作。 但是這個煩人的消息隨每個rails命令一起提供。 我將存儲庫克隆到另一個文件夾並創建了另一個存儲庫,並將代碼推送到新的存儲庫。 錯誤也在我的新文件夾中。
我用git init
重新初始化了我現有的Git存儲庫,但沒有改變。
當我設置一個新的rails項目並將其推入新的存儲庫等時,沒有錯誤。 我的項目有什么問題? 任何想法,為什么會發生這種情況以及如何解決這個問題?
我正在使用ruby 1.9.3
, rails 3.2.1
和git 1.7.9
。
thx到@manojlds我可以更多地隔離問題。 這是therubyracer的寶石。 我不知道究竟是什么問題,但因為我在Windows上我使用這個特殊的therubyracer寶石: https : //github.com/hiranpeiris/therubyracer_for_windows 。 所以我會向開發人員詢問這個特殊的gem並向他展示bundler bug。 也許他會知道這是他的寶石還是捆綁者的問題。 捆綁器具有更新的預發布。 但我無法在Windows上安裝預發行版。 所以我必須等待,因此我必須忍受這個煩人的消息。 或者有沒有辦法禁用這些消息?
這是我的github問題: https : //github.com/hiranpeiris/therubyracer_for_windows/issues/1
嘗試運行git init
RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0beta1-x86-mingw32
。
它會在那里初始化一個新的空git repo。
Bundler有一個錯誤,可能是相關的: https : //github.com/carlhuda/bundler/issues/2039
絕對不是git或你的git repo的問題。 嘗試更新bundler。 (不確定修復程序是否處於穩定版本)
運行該命令時,請確保您位於正確的目錄中:
git tag
我從git安裝node.js時遇到了同樣的問題,發現在下載后我必須在子目錄中才能顯示標簽版本。
例如,我運行此命令來獲取node.js:
git clone https://github.com/joyent/node.git
...但是在git tag
命令工作之前,必須將cd node
放在node子目錄中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.