Forum: Ruby on Rails daemons load activesupport 2.2.2 instead of 2.1.0, causing failure

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2dddec0f7717cae77ac6bceede6be5bc?d=identicon&s=25 Ram (Guest)
on 2009-05-11 10:01
(Received via mailing list)
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?
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-05-11 10:32
(Received via mailing list)
On May 11, 9:00 am, Ram <yourstruly.vi...@gmail.com> 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
2dddec0f7717cae77ac6bceede6be5bc?d=identicon&s=25 Ram (Guest)
on 2009-05-11 11:09
(Received via mailing list)
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 Cheung <frederick.che...@gmail.com>
2dddec0f7717cae77ac6bceede6be5bc?d=identicon&s=25 Ram (Guest)
on 2009-05-11 14:45
(Received via mailing list)
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?
This topic is locked and can not be replied to.