Although this is presumably a situation commonly encountered, it’s hard to find the instructions on how to install your own private gems in a shared hosting environment — where you don’t normally have root access.

Here are the steps:
$ mkdir /home/julian/gems
$ gem environment
RubyGems Environment:
- VERSION: 0.9.4 (0.9.4)
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- GEM PATH:
- /usr/local/lib/ruby/gems/1.8
- REMOTE SOURCES:
- http://gems.rubyforge.org
$ vi /home/julian/.gemrc gemhome: /home/julian/gems gempath: - /home/julian/gems - /usr/local/lib/ruby/gems/1.8
$ vi /home/julian/.bashrc ... GEM_HOME=/home/julian/gems GEM_PATH=/home/julian/gems:/usr/local/lib/ruby/gems/1.8 export GEM_HOME GEM_PATH
With the above settings in place, you can now install and use your own private Ruby gems in your home directory.
Commenting is closed for this article.