Tôi có ứng dụng Rails 3.1.3 và cố gắng cắm gem "redis" vào đó.Không thể tìm bộ điều hợp lưu trữ bộ nhớ cache cho redis_store
Tôi đã thêm đá quý sau vào Gemfile:
gem "redis-store"
Tiếp theo bài viết này, tôi đã thêm mã để môi trường sau/development.rb:
config.gem "redis-store", :lib => "redis-store"
require "redis-store" # HACK
config.cache_store = :redis_store
Ứng dụng sẽ không bắt đầu, phàn nàn với cache_store:
/gems/activesupport-3.1.3/lib/active_support/cache.rb:65:in `lookup_store ': Không tìm thấy bộ lưu trữ bộ nhớ cache cho redis_store (không tải tệp như vậy - active_support/cache/redis_store) (RuntimeError).
Tôi đã figured it out, bao gồm đá quý "redis-ray" thay vì "redis-store", nhưng tôi nhận được một lỗi:
/Users/AntonAL/.rvm/gems/[email protected]/gems/bundler-1.0.21/lib/bundler/rubygems_integration.rb:143:in `gem': redis-store is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
Giữ cả hai ...
gem 'redis-store'
gem 'redis-rails'
… đưa ra một lỗi khác
…gems/redis-rails-0.0.0/lib/redis-rails/version.rb:1: Redis is not a module (TypeError)
from …/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from …/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from …/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
from …/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
from …/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
from …/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from …/gems/redis-rails-0.0.0/lib/redis-rails.rb:1
from …/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from …/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from …/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
from …/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `require'
from …/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
from …/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
from …/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
from …/config/application.rb:11
from …/gems/railties-3.1.3/lib/rails/commands.rb:52:in `require'
from …/gems/railties-3.1.3/lib/rails/commands.rb:52
from …/gems/railties-3.1.3/lib/rails/commands.rb:49:in `tap'
from …/gems/railties-3.1.3/lib/rails/commands.rb:49
from script/rails:6:in `require'
from script/rails:6
Trợ giúp, vui lòng!
Cảm ơn, gần đây tôi cũng tìm thấy một giải pháp. Tôi có thể chỉ định phiên bản "redis-store" khớp với phiên bản môi trường đường ray của tôi. – AntonAL
Blam! Cảm ơn một triệu million.rand – Trip