# Custom gem directory: monit doesn't start backgroundrb

**URL:** <https://www.ruby-forum.com/t/custom-gem-directory-monit-doesnt-start-backgroundrb/130780>\
**Category:** Deployment\
**Created:** [March 3, 2008, 10:17am UTC](https://www.ruby-forum.com/t/custom-gem-directory-monit-doesnt-start-backgroundrb/130780 "2008-03-03T10:17:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hawe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/8e7dd6/32.png) [@hawe](https://www.ruby-forum.com/u/hawe)\
**Post date:** [March 3, 2008, 10:17am UTC](https://www.ruby-forum.com/t/custom-gem-directory-monit-doesnt-start-backgroundrb/130780/1 "2008-03-03T10:17:28Z")

</div>

Hi!

Backgroundrb works fine until I tried to monitor it with monit! Here is  
a part from the .monitrc file:

check process backgroundrb with pidfile  
/home/user/domain/log/backgroundrb.pid  
start program = “/home/user/.packages/bin/ruby  
/home/user/domain/script/backgroundrb start”

So, yes I’ve my custom ruby at /home/user/.packages/bin/ruby, but I also  
have a custom gem directory (for Rails 2.0.2. and other custom gems) at  
/home/user/.gems . Running the start program command from above in the  
bash works fine, but “monit start all” gives me this error:

Cannot find gem for Rails ~\>2.0.2.0:  
Install the missing gem with ‘gem install -v=2.0.2 rails’, or  
change environment.rb to define RAILS\_GEM\_VERSION with your desired  
version.

Why? I already set RAILS\_GEM\_VERSION and even ENV[‘GEM\_PATH’] =  
‘/home/user/.gems:/usr/lib/ruby/gems/1.8’

Here are rumors about the environment, but it doesn’t work:  
[http://www.ruby-forum.com/topic/103941](http://www.ruby-forum.com/topic/103941)

If you have any ideas, your help will be much appreciated.  
Thanks, Hawe-
