gitlabhq/gitlab-shell — pull request #170 by ruhland (2014-08-12 21:23:00+00:00)
Title: HOME Environment can be necessary for gem

Setup: CentOS 6, gitlab 7.1.1, ruby 1.9.3, gem 1.8.23

git push resulted in:
```
remote: /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require': cannot load such file -- json (LoadError)
remote:	from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
remote:	from /home/git/gitlab-shell/lib/gitlab_net.rb:3:in `'
remote:	from /home/git/gitlab-shell/lib/gitlab_update.rb:3:in `require_relative'
remote:	from /home/git/gitlab-shell/lib/gitlab_update.rb:3:in `'
remote:	from hooks/update:11:in `require_relative'
remote:	from hooks/update:11:in `

'
remote: error: hook declined to update refs/heads/master
```

`.ssh/environment` contains `PATH=/home/git/gitlab/vendor/bundle/ruby/1.9.1/bin...`

gem seems to need `HOME` environment variable:
```
>unset HOME
>gem environment
ERROR: While executing gem ... (ArgumentError)
couldn't find HOME environment -- expanding `~'
```