我已经设置了一个钩子,因为它作为我的普通用户之一运行良好,并且在该用户下使用gem install --user-install
. 现在我想以不同的用户身份运行该钩子,但是当我尝试它时,ruby 找不到已安装的 gem:
$ /home/user/.gem/ruby/1.9.1/bin/jekyll
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find jekyll (>= 0) amongst [rack-1.5.2, rack-protection-1.5.0, ruby-openid-2.1.8, sinatra-1.0, tilt-1.3.6] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /usr/lib/ruby/1.9.1/rubygems.rb:1210:in `gem'
from /home/user/.gem/ruby/1.9.1/bin/jekyll:18:in `<main>'