更新时间:2023-01-14 21:40:43
参见 http://www.rubygems.org/read/chapter/11 并指定一个定义 gemhome 变量的 ~/.gemrc
.
See http://www.rubygems.org/read/chapter/11 and specify a ~/.gemrc
which defines a gemhome variable.
例如:
gemhome: /usr/local/rubygems
你也可以把这个文件放在/etc/gemrc
You can also place this file in /etc/gemrc
或者,您可以设置 GEM_HOME
环境变量:
Alternatively you can set the GEM_HOME
env-variable:
$ export GEM_HOME=/tmp/gemtest
$ gem install bundler
$ ls /tmp/gemtest/bin/
bundle
更新(10 年后):
Andrey Rodionov 下面建议使用
Andrey Rodionov below suggest using
gem: --bindir /usr/bin