# Daemons load activesupport 2.2.2 instead of 2.1.0, causing failure

**URL:** <https://www.ruby-forum.com/t/daemons-load-activesupport-2-2-2-instead-of-2-1-0-causing-failure/167665>\
**Category:** Rails\
**Created:** [May 11, 2009, 10:01am UTC](https://www.ruby-forum.com/t/daemons-load-activesupport-2-2-2-instead-of-2-1-0-causing-failure/167665 "2009-05-11T10:01:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9bd4f/32.png) [@ram](https://www.ruby-forum.com/u/ram)\
**Post date:** [May 11, 2009, 10:01am UTC](https://www.ruby-forum.com/t/daemons-load-activesupport-2-2-2-instead-of-2-1-0-causing-failure/167665/1 "2009-05-11T10:01:56Z")

</div>

Hi,

I have a couple of daemons that im trying to setup to be run for my  
app. The environment load is as follows…

ENV[“RAILS\_ENV”] ||= “development”  
require File.join(File.dirname( **FILE** ), “/…/…/config/environment”)

And the error I get is

#\<LoadError: no such file to load – active\_support\>  
#\<Gem::Exception: can’t activate activesupport (= 2.1.0, runtime),  
already activated activesupport-2.2.2\>

I have activesupport 2.2.2, 2.1.0 and 1.4.4 installed and I think it  
just loads the latest version available.  
How do I force the daemon to load 2.1.0? I understand that in  
production too, it loads the latest version of rails and all other  
gems available. But I need it to use the versions I specify.

Any ideas at all on how to do this?

---

<div class="post-metadata">

**Author:** ![ram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9bd4f/32.png) [@ram](https://www.ruby-forum.com/u/ram)\
**Post date:** [May 11, 2009, 10:32am UTC](https://www.ruby-forum.com/t/daemons-load-activesupport-2-2-2-instead-of-2-1-0-causing-failure/167665/2 "2009-05-11T10:32:25Z")

</div>

On May 11, 9:00 am, Ram [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> #\<LoadError: no such file to load – active\_support\>  
> #\<Gem::Exception: can’t activate activesupport (= 2.1.0, runtime),  
> already activated activesupport-2.2.2\>
> 
> I have activesupport 2.2.2, 2.1.0 and 1.4.4 installed and I think it  
> just loads the latest version available.  
> How do I force the daemon to load 2.1.0? I understand that in  
> production too, it loads the latest version of rails and all other  
> gems available. But I need it to use the versions I specify.
> 
> Any ideas at all on how to do this?

you can use gem ‘some\_gem’, ‘=1.2.3’ to force version 1.2.3 of the gem  
some\_gem to be loaded, or you can make sure that whatever is loading  
activesupport without specifying a version tries to do so after the  
thing that loads a specific version.

Fred

---

<div class="post-metadata">

**Author:** ![ram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9bd4f/32.png) [@ram](https://www.ruby-forum.com/u/ram)\
**Post date:** [May 11, 2009, 11:09am UTC](https://www.ruby-forum.com/t/daemons-load-activesupport-2-2-2-instead-of-2-1-0-causing-failure/167665/3 "2009-05-11T11:09:26Z")

</div>

Hi Fred,

I did read about this solution elsewhere before starting this thread.  
So i did

gem ‘activesupport’, ‘=2.1.0’  
require ‘activesupport’  
require File.join(File.dirname( **FILE** ), “/…/…/config/environment”)

But then I got the errors

\<LoadError: no such file to load – active\_support\>  
\<Errno::ENOENT: No such file or directory - /Users/fire/Sites/Vinay/  
ROR/RealApps/fi\_rest\_auth/log/recurring.rb.pid\>  
\<NameError: uninitialized constant Repeat\> #Repeat being one of the  
models of my app.

Im trying to uninstall activesupport 2.2.2 from my machine but not  
getting anywhere with that either. Even if I DO manage that in my  
local machine, in production, the daemon is still gonna trouble me by  
loading the latest gem versions rt?

On May 11, 1:31 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![ram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9bd4f/32.png) [@ram](https://www.ruby-forum.com/u/ram)\
**Post date:** [May 11, 2009, 2:45pm UTC](https://www.ruby-forum.com/t/daemons-load-activesupport-2-2-2-instead-of-2-1-0-causing-failure/167665/4 "2009-05-11T14:45:40Z")

</div>

I honestly dont understand why or how but it started working when I  
replaced

require File.dirname( **FILE** ), “/…/…/config/environment”

with

require File.join(File.dirname( **FILE** ), “/…/…/config/  
environment”).

There is one other problem now though. When the daemon is running, it  
does not output anything to the log file. I can only see its progress  
in the development log.  
Once the daemon is stopped, it outputs some stuff and a few errors  
which make no sense because the daemon runs successfully. (including  
“No such file to load activesupport”)

My daemon is called reminders\_ctl and the log/reminders.rb.log is the  
log file im looking into. How do I make it o/p to this log file so  
that I can monitor the daemons progress from this one file?
