Hi all - i'm trying to get memcached and the Interlock plugin working with a new rails app. The weird thing is that they both work fine in another app on the same machine and i can't figure out the difference that's stopping this app. The new app is rails 2.3.4 and the old one is 2.2.2 in case that's a factor.
When the app starts, i get a warning from interlock:
`install_memcached':Interlock::ConfigurationError: 'memcache-client' client requested but not installed. Try 'sudo gem install memcache-client'.
Now, i have memcache-client installed:
$> gem list | grep memcache
memcache-client (1.7.8)
The gem is in /var/lib/gems/1.8, which is in my GEM_PATH variable.
On a bit of further investigation, the above error is raised by interlock when it refers to the MemCache class, which doesn't exist and so raises an 'anonymous module' error. So, ultimately, the problem is that MemCache isn't loaded. I have a memcached.yml in my config folder (below) however. I'm stuck - any advice anyone?
#contents of config/memcached.yml
defaults:
namespace: millionaire
#sessions: true
sessions: false
client: memcache-client
with_finders: true
development:
servers:
- 127.0.0.1:11211
production:
servers:
- 127.0.0.1:11211
EDIT - solved
The issue was how i was specifying the gem to use: i had to put this in my config/environment.rb file:
config.gem "memcache-client", :version => '1.5.0', :lib => "memcache"
This seems to be necessary when i use gems where the lib folder isn't called lib or the main file in the lib folder doesn't have the same name as the gem: i have to specify the lib/file name with the :lib option.
Kind of confused about this still but at least it works.