Thursday, January 20, 2011

Getting error "Retrieving unmerged branches Error:" when trying to push Rails application code from RubyMine

Yesterday, when I was trying to push the Rails3 application code from RubyMine, I got a strange error.
Errors was:
Retrieving unmerged branches Error:
Process failed to start (git branch --no-color): com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "/usr/local/git/bin/git" (in directory "C:\projects\rails3_app"): CreateProcess error=2, The system cannot find the file specified

Let me explain the scenario about this error in a bit more detail. I had cloned a Rails application and committed in git as a branch of that application. Then I took checkout on other system and modified the code. When I was trying to push my changes through RubyMine I got the above errors and I was not able to push the code.

After long time of google and findings, I found the solution myself.
Reason of the error was that when we open any Rails application through RubyMine, it creates a ".idea" folder and that folder was commited when creating the branch. And when I took checkout of the code, the ".idea" folder of another computer's RubyMine setting was cloned on another system which was creating error.

Solution was quite a simple one. I just closed the newly created Rails3 project on RubyMine and deleted the ".idea" folder of the application. Then again I opened the project and this time I was able to push my code changes. Main point to note here is that you need to close the project from RubyMine before deleting the folder or else RubyMine will create the old folder again if the project is not closed.


No comments:

Post a Comment