Please Login or Register

How do I install my own Gems?

The easiest and fastest way to install Ruby gems is to install them in your local directory, you will need shell access. To install your own gems use the following steps:

1) Using File Manager in your cPanel make a copy of the .bashrc file in your root directory, name it .bashrc.bak.
2) Now edit the .bashrc file and add the following to the end of the file:

export PATH="$PATH:$HOME/packages/bin:$HOME/.gems/bin"
export GEM_HOME="$HOME/.gems"
export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8"

export GEM_CACHE=”$GEM_HOME/cache”

3) Using your favorite SSH client connect to your site.



4) at the prompt type:

cp /usr/lib/ruby/gems/1.8/cache/sources-0.0.1.gem ./

gem install sources-0.0.1.gem

gem update -y



This will update rails to the latest version and install it to your local gem directory.


5) When using a rails application, make sure you add the following to your ./config/environment.rb:

ENV['GEM_PATH'] = '/path/to/your/home/.gems:/usr/lib/ruby/gems/1.8'

Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read

awards_sum