Cannot load gems in custom_hooks with gitlab-web
We had the following before switching to the gitlab omnibus package:
#!/usr/bin/ruby
require 'mcollective'
require 'safe_yaml'
This stopped working after we started using the omnibus package instead. Changing the header to "#!/usr/bin/env ruby" allow to write some ruby code that will work, but I still cannot load gems. (this work with gitlab-shell/pushing using git)
I tried the following:
- install gems using /opt/gitlab/embedded/bin/gem (the gems are not in the load_path, but this work with gitlab-shell)
- amend the load_path to include /usr/lib/ruby/vendor_ruby, or /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/mcollective-client-2.7.0/lib/
None seem to work.
My question is as follow:
How can I load external ruby libs (ideally gems) to use in my custom hook, and have them work with the gitlab web interface?