无论我做什么,gem install都安装到我的家中,包括/root/.gem/ruby/2.5.0/gems而不是/usr/lib/ruby/gems/2.5.0。
某些背景信息:
# type gem
gem is hashed (/usr/bin/gem)
# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),19(log)
这是确切的命令:
# /usr/bin/gem install --verbose --install-dir /usr/lib/ruby/gems/2.5.0 aws-sdk
ERROR: Use --install-dir or --user-install but not both
但是从这个选项的位置来看: - 用户安装?
默认选项中没有任何内容:
# gem install --help
Usage: gem install GEMNAME [GEMNAME ...] [options] -- --build-flags [options]
<...>
Defaults:
--both --version '>= 0' --document --no-force
--install-dir /usr/lib/ruby/gems/2.5.0 --lock
我可以在/ usr / lib / ruby中安装什么?
答案 0 :(得分:0)
我找到了原因。 全局配置/ etc / gemrc
/ etc / gemrc:
# Read about the gemrc format at http://guides.rubygems.org/command-reference/#gem-environment
# --user-install is used to install to $HOME/.gem/ by default since we want to separate
# pacman installed gems and gem installed gems
gem: --user-install