From: "Iñaki Baz Castillo" Date: 2012-08-30T01:16:56+09:00 Subject: How to add a non standard Gem path? Hi, I would like to install some Gems in a custom directory (i.e. /usr/local/gems/), so such a directory will have the following structure: ibc@myhost: /usr/local/gems$ ls -l drwxr-xr-x 2 root root 4,0K ago 29 18:02 bin/ drwxr-xr-x 2 root root 4,0K ago 29 18:01 cache/ drwxr-xr-x 2 root root 4,0K ago 29 18:01 doc/ drwxr-xr-x 6 root root 4,0K ago 29 18:01 gems/ drwxr-xr-x 2 root root 4,0K ago 29 18:02 specifications/ Once I've started a Ruby script, how can I tell the "require" command to include my custom Gem directory so "require GEM_NAME" command looks first in /usr/local/gems/gems/*/lib/* ? I've tryed modifying the Gem.path which by default has this value: Gem.path => [ "/var/lib/gems/1.9.1", "/home/ibc/.gem/ruby/1.9.1"] so I've added my directory: Gem.path.insert 0, "/usr/local/gems" Gem.path => ["/tmp/gems", "/var/lib/gems/1.9.1", "/home/ibc/.gem/ruby/1.9.1"] But this does not work, "require" command does not search there. Any help please? Thanks a lot. -- Iñaki Baz Castillo