Rubymine, rvm, git and overcommit issues

Something I've struggled with in my environment recently using RubyMine/IntelliJ across multiple projects is the git integration. There is

overcommit-error-message

When committing/pulling from a git repo it would often complain about ruby version mismatches, overcommit gem not being installed etc.

After some digging, I finally came across an old bug report in the RubyMine backlog which explains the behaviours I've been experiencing.

The root cause seems to be RubyMine not respecting the ruby version as set by rvm for each project, and it is in fact using the default system ruby. Once I realized this, the issue symptoms I was seeing started to make a lot of sense! Alas, the bug was marked as "won't fix"

Some developers have mentioned having more success with rbenv instead of rvm, but haven't seen consensus with that either. Another workaround is to use github for mac desktop application - but the trick is to launch it from the command line from your project root folder, so it has the ruby environment loaded. This is a pain too, especially when working on several projects, each with their own ruby version and even overcommit version conflicts.

Once I find an acceptable workaround I'll update this post, but hopefully this will get some exposure for others experiencing the same issue, or someone can reach out if they have a better workaround/solution!