Forum: Ruby on Rails Rails 2.3 Upgrade Issue with MemCache

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.
5f3d52658aafcf0aabe76a5147e8909f?d=identicon&s=25 TomRossi7 (Guest)
on 2009-03-20 14:43
(Received via mailing list)
One of the plugins I use is Workling.  It throws the following error
when I try to run it under 2.3:

/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/
dependencies.rb:443:in `load_missing_constant': uninitialized constant
MemCache (NameError)

The offending line is:

      @@memcache_client_class ||= ::MemCache

I don't know a lot about memcache, so I'm not sure what changed with
2.3 that could cause the error.  Anyone have some ideas?

Thanks!
Tom
4c438a80fc30661ad619ea177cf9cbd0?d=identicon&s=25 Freddy Andersen (Guest)
on 2009-04-08 02:15
(Received via mailing list)
I'm not sure why this happens, BUT in rails 2.3.2 you have to wrap
your Workling loader a after_init like so:

config.after_initialize do
  Workling::Remote.dispatcher =
Workling::Remote::Runners::StarlingRunner.new
end
E98de78bb42013c488fe8aa9d77d2cb1?d=identicon&s=25 Steve Odom (Guest)
on 2009-04-08 05:20
(Received via mailing list)
I'm having the same issue as Tom, but I'm not using Starling. I'm
using spawn. I don't have anything in an initializer to wrap in a
after_initialize.

Any ideas how to get workling to work in 2.3?

Steve
5f3d52658aafcf0aabe76a5147e8909f?d=identicon&s=25 tomrossi7 (Guest)
on 2009-04-08 14:32
(Received via mailing list)
Steve,

Try throwing require 'memcache' in your environment.rb?  I think that
is how I finally got around it...

Thanks,
Tom
E98de78bb42013c488fe8aa9d77d2cb1?d=identicon&s=25 Steve Odom (Guest)
on 2009-04-08 16:01
(Received via mailing list)
Thanks Tom. The crappy part is I'm not using memcache for anything at
the moment.

Steve
5f3d52658aafcf0aabe76a5147e8909f?d=identicon&s=25 tomrossi7 (Guest)
on 2009-04-08 16:18
(Received via mailing list)
Ugh.  But did it solve the problem?
E98de78bb42013c488fe8aa9d77d2cb1?d=identicon&s=25 Steve Odom (Guest)
on 2009-04-09 15:18
(Received via mailing list)
Unfortunately it didn't solve the problem. I guess I could switch over
to starling and that might solve it.
5f3d52658aafcf0aabe76a5147e8909f?d=identicon&s=25 tomrossi7 (Guest)
on 2009-04-09 16:10
(Received via mailing list)
Steve,

I put a debugger statement in the plugin to figure out the problem.
The error is definitely telling you that memcache hasn't been loaded.
You may need to move that require 'memcache' statement around to make
sure it is loading.  Let me know what you find...

Thanks,
Tom
2f8ec4a9ad7a39534f764d749e001046?d=identicon&s=25 Arzumy MD (Guest)
on 2009-05-06 17:52
(Received via mailing list)
Hi guys,

I got the same problem this morning. workling throws memcache error on
2.3
Found out that after_init solution works. And if you are using
workling + spawner, these lines work fine with me

config.after_initialize do
   Workling::Remote::Runners::SpawnRunner.options = { :method
=> :spawn }
   Workling::Remote.dispatcher =
Workling::Remote::Runners::SpawnRunner.new
end

Cheers!
De396cedd7085b8ac01f8c18a7e24167?d=identicon&s=25 Aaron Gibralter (agibralter)
on 2009-08-10 15:32
I was having the same problem. I use NotRemoteRunner in dev mode and
StarlingRunner in production right now. I found that putting the
following code in development.rb solved my problem:

config.after_initialize do
  Workling::Remote.dispatcher =
Workling::Remote::Runners::NotRemoteRunner.new
end

Thanks!

-ajg-

Freddy Andersen wrote:
> I'm not sure why this happens, BUT in rails 2.3.2 you have to wrap
> your Workling loader a after_init like so:
>
> config.after_initialize do
>   Workling::Remote.dispatcher =
> Workling::Remote::Runners::StarlingRunner.new
> end
This topic is locked and can not be replied to.