Chris Chris - 5 months ago 27x
Ruby Question

Error when using overcommit and Github Desktop

I am using overcommit gem ( in my project, when I use Github Desktop for osx I get these errors:

This repository contains hooks installed by Overcommit, but the
gem is not installed. Install it with
gem install
. (1)

The gem is installed, it works in terminal. I guess it's because I use rvm and Github Desktop doesn't know about rvm. Anybody knows how to fix this?


Most likely it's this line where the error occurs. As you can see the main issue is that it's not able to require 'overcommit'. I don't know the GitHub desktop client so well (maybe there is a way to configure it inside of it), but one thing you could do is adding the absolute path where rvm stores your gems to the "require path" in the hook file. This could look like:

$: << "/home/user/.rvm/path/to/gems/dir"

The disadvantage of this is that you would have your absolute path in the hook file and it most likely won't work for others. You might also want to consider installing the gem globally for the the ruby interpreter that executes the script (see Shebang line in the hook file).