Monday, October 6, 2008

How to install ruby gem locally (for current site only)

1. Install gem locally on your development machine:

$ cd /projects/my_webapp
$ gem install acts_as_versioned -i ./lib

Now in addition to your global gem path, you have "./lib" path for your personal gems.

2. How to tell Ruby about your path:
$ cd my_webapp/config/environment/

Edit development.rb:
Gem.use_paths(nil,["#{RAILS_ROOT}/lib"])

The same operation must be done on test.rb and production.rb.

No comments: