Questions tagged [redis-rails]

17 questions
6
votes
1 answer

Rails, Redis and Sentinel

I have a Redis cluster of 4 nodes, 1 master and 3 slaves, monitored by Sentinel. Now in rails I need to connect to this cluster, reading from the nearest replica, and writing to the master, the same as I do with MongoDB. Using the redis-rails gem,…
bukk530
  • 1,858
  • 2
  • 20
  • 30
3
votes
2 answers

Ruby On Rails, Redis::CommandError: ERR wrong number of arguments for 'set' command

Why does this code redis.set("test", true, ex: 24.hours) return the following exception? Redis::CommandError: ERR wrong number of arguments for 'set' command I use these gems redis (3.2.0) redis-rails (4.0.0)
user1531875
  • 49
  • 2
  • 8
2
votes
1 answer

Rails.cache.fetch returns nil

I am trying to implement cache in my rails 4 app. I installed redis, setup config according this article but every time I try to cache something in my controller, on first refresh I get data, on second I get nil. When I go to redis cli and I do…
Mi Ro
  • 740
  • 1
  • 6
  • 31
2
votes
1 answer

Is it secure to use redis-rails as session store?

When used as a session store, I noticed that redis-rails saves the session id in unencrypted format in the cookie. Shouldn't session id be treated as secure information and not be exposed in a cookie unencrypted to thwart session-hijacking attempts?
RajeshT
  • 417
  • 4
  • 9
1
vote
1 answer

Keeping Existing Sessions When Upgrading to Rails 5.2 (with Redis Session Store)

I have recently finished a big upgrade of a Rails application. I took the App incrementally from Rails 4.2.8 to Rails 5.2.3. Everything has gone smoothly, all our automated tests are passing, and we've begun user acceptance testing. So far the only…
1
vote
1 answer

with redis-rails, how to delete all but sessions cache?

Rails 5.1 app, redis-rails gem 5.0.2 Gemfile gem "rails", "~> 5.1" gem "redis-rails" in production.rb config.cache_store = :redis_store, ENV.fetch("REDISCLOUD_URL") in session_store.rb Rails.application.config.session_store :redis_store, servers:…
AndreiMotinga
  • 1,024
  • 17
  • 24
1
vote
1 answer

How to set the configuration for middleware for ActionDispatch::Session::RedisStore and Devise

I'm using the gem redis-rails and doesn't work for api mode. I do not know how to pass the redis configuration for session_store. Ruby 2.5.0, Rails 5.1.4, Devise 4.4.0, redis-rails 5.0.2 #config/application.rb config.api_only = true # needed for…
el_verdor
  • 21
  • 5
1
vote
1 answer

How do I implement connection pooling for Redis-As-Rails-Cache (using Redis as rails cache) Rails 4.1?

How can I add connection pooling to my Redis setup? for some reason I can't seem to find any information on this. I'm using redis (3.2.0) set up like so: (you can assume resque_uri and cache_uri has been parsed ahead of this c) for…
Jason FB
  • 4,752
  • 3
  • 38
  • 69
1
vote
0 answers

Websocket-rails and redis-rb do not restore Pub/Sub Channel on failover

I'm using websocket-rails in a synchronized cluster configuration: 2 Rails Instances (FrontEnd) 2 Redis Instances, One Master one Slave (Backend) 4 Sentinel Instances on all Nodes Websocket-rails successfully creates a connection via redis-rb by…
1
vote
2 answers

Redis search for keys with a value

How do you search for keys with a value in Ruby? For example get all KEYS where the value is "somevalue". My keys are "xyz" => {:status=> "connected", :topic=> "ABC"} "PQR" => {:status=> "connected", :topic=> "ABC"} Now I need to find all the KEYS…
Shrikanth Hathwar
  • 1,140
  • 4
  • 14
  • 25
0
votes
0 answers

ROR SESSION STORE: Session store with :redis_store not getting cookie with session_id in it in response

session_store.rb Rails.application.config.session_store :redis_store, servers: ["redis://localhost:6379/0/session"], expire_after: 90.minutes, …
0
votes
0 answers

Why doesn't Redis work with my Rails application?

I'm currently using Rails 6 and Linux mint Cinnamon 20.2, and I have problems with Redis configuration / setupping in my Rails application. My problem is that my ActionCable doesn't work well. I would like to build a real time chat app, I created a…
0
votes
2 answers

How to set maxmemory for RedisCloud addon on heroku ( rails app )?

If memory consumption goes over available memory app crashes. So far I've changed memory-policy from volatile-lru to allkeys-lru via plugin's dashboard. However I'm not sure it'll work since I'm not sure of maxmemory it'll try to use. redis-rails…
AndreiMotinga
  • 1,024
  • 17
  • 24
0
votes
1 answer

Issues with redis-rails and connection_pool

How I can initialize my redis_store to have connection pooling. I want to add pooling attributes { pool_size: 10, pool_timeout: 10 } I have added connection_pool gem Example::Application.config.session_store :redis_store, …
Ch Zeeshan
  • 1,644
  • 11
  • 29
0
votes
1 answer

Vagrant+Ansible+Redis - Get 127.0.0.1:6379 (Errno::ECONNREFUSED) when using different servers

Hope everything is well. I have the following problem and was hoping you could help me out: I'm trying to deploy my rails 4 app using vagrant and ansible. Part of the app is a redis server. I have this set up and running at a 192.168.33.2:6379, my…
PSR
  • 513
  • 6
  • 16
1
2