У меня есть приложение Rails 3.1.3, и я пытаюсь подключить к нему гем "redis".
Я добавил следующий гем в Gemfile:
гем "redis-store"
Следуя этой статье, я добавил следующий код в environments/development.rb:
config.gem "redis-store", :lib => "redis-store"
require "redis-store" # HACK
config.cache_store = :redis_store
Приложение не запускается , жалуясь в cache_store:
/gems/activesupport-3.1.3/lib/active_support/cache.rb:65:in `lookup_store': не удалось найти адаптер хранилища кеша для redis_store (нет такого файла для загрузки -- active_support/ cache/redis_store) (RuntimeError).
Я разобрался, включая гем "redis-rails" вместо "redis-store", но получаю другую ошибку:
(скрыто) `gem': redis-store не является частью расслоение. Добавьте его в Gemfile. (Gem::LoadError)
Сохранение обоих…
gem 'redis-store'
gem 'redis-rails'
…выдает другую ошибку
…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
Помогите, пожалуйста!