sh: error importing function definition for `parse_git_branch'

When running bundle install or when RubyMine decides to get the available rake tasks or generators, I can a number of errors, like this:

[rake --tasks] sh: parse_git_branch: line 1: syntax error: unexpected end of file

sh: error importing function definition for `parse_git_branch'

sh: parse_git_branch: line 1: syntax error: unexpected end of file

sh: error importing function definition for `parse_git_branch'

sh: parse_git_branch: line 1: syntax error: unexpected end of file

sh: error importing function definition for `parse_git_branch'

sh: parse_git_branch: line 1: syntax error: unexpected end of file

sh: error importing function definition for `parse_git_branch'

sh: parse_git_branch: line 1: syntax error: unexpected end of file

sh: error importing function definition for `parse_git_branch'

sh: parse_git_branch: line 1: syntax error: unexpected end of file

sh: error importing function definition for `parse_git_branch'

sh: parse_git_branch: line 1: syntax error: unexpected end of file

sh: error importing function definition for `parse_git_branch'

sh: parse_git_branch: line 1: syntax error: unexpected end of file

sh: error importing function definition for `parse_git_branch'

sh: parse_git_branch: line 1: syntax error: unexpected end of file

sh: error importing function definition for `parse_git_branch'

sh: parse_git_branch: line 1: syntax error: unexpected end of file

sh: error importing function definition for `parse_git_branch'

sh: parse_git_branch: line 1: syntax error: unexpected end of file

sh: error importing function definition for `parse_git_branch'

sh: parse_git_branch: line 1: syntax error: unexpected end of file

sh: error importing function definition for `parse_git_branch'



Are there any known fixes?

When running bundle install, the error occurs when processing lines in the Gemfile like:

gem 'stripe', :git => "https://github.com/stripe/stripe-ruby"


None of these errors occur on the command line.
4 comments
Comment actions Permalink

I discovered that this is actually in my bash dotfiles.

So now I'm wondering if there is a way to customize how RubyMine starts external processes? (e.g., so that maybe I could tweat it to not run this one or something...)

0
Comment actions Permalink

Alternatively, perhaps someone can suggest a modification to the function (which sets the current git branch, if any, into my prompt) that would make it play nice with RubyMine?

parse_git_branch() {

  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'

}                                                                                                                                                                                               

export -f parse_git_branch

export CLICOLOR=1

export PS1="\[\033[36m\]\h:\W \[\033[33m\]\$(parse_git_branch)\[\033[00m\]\$(git config user.initials)$\[\033[00m\] "                                                                           

export SUDO_PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;31m\]\$ \[\e[0m\]'

0
Comment actions Permalink

I'm having this problem as well.  Today I Learned that Rubymine caches your bash dotfiles, so edits made to try to debug this issue require a restart of Rubymine to prove out.

0
Comment actions Permalink

Adding

-Drubymine.console.environment=disabled
into the .vmoptions file: http://intellij-support.jetbrains.com/entries/23395793 should fix it.
0

Please sign in to leave a comment.