当我使用memcache(gem)和rails 3.0.0beta
启动项目时出现此错误以下是完整的跟踪:
/Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache/mem_cache_store.rb:39:in `build_mem_cache': uninitialized constant ActiveSupport::Cache::MemCacheStore::MemCache (NameError)
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache/mem_cache_store.rb:65:in `initialize'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache.rb:64:in `new'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache.rb:64:in `lookup_store'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application/bootstrap.rb:47
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/core_ext/kernel/reporting.rb:22:in `with_warnings'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application/bootstrap.rb:47
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:25:in `run'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:55:in `run_initializers'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:54:in `each'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application.rb:119:in `initialize!'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application.rb:81:in `send'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application.rb:81:in `method_missing'
from /Users/netbe/Projects/banana/config/environment.rb:5
from config.ru:3:in `require'
from config.ru:3
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize'
from config.ru:1:in `new'
from config.ru:1
以下是来自我的environment.rb,第5行:模块缓存
的一些代码require 'active_support/cache'
module ActiveSupport
module Cache
class MemCacheStore < Store
def logger
Rails.logger
end
end
end
end
有没有人可以猜到这里有什么问题,这是轨道3的问题吗?
答案 0 :(得分:6)
实际上你没有在你的Gemfile中添加gem“memcache-client”,显然你只有gem“memcache”
答案 1 :(得分:0)
我认为我的答案太晚了:)但可能对某人有所帮助。我有同样的错误,问题出在lib / memcache.rb目录中的文件名。重命名后,项目照常启动。