Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to set up Redis session store with Rails 4? #160

Closed
youroff opened this issue Jan 11, 2013 · 16 comments
Closed

Is there any way to set up Redis session store with Rails 4? #160

youroff opened this issue Jan 11, 2013 · 16 comments

Comments

@youroff
Copy link

youroff commented Jan 11, 2013

It doesn't seem to be working in Rails 4 due to version dependencies I guess. Any updates on the way?

@mhoran
Copy link
Contributor

mhoran commented Jan 12, 2013

If the API hasn't changed too much, this should be easy. However, I haven't investigated compatibility, and there's nothing currently on the radar. We'd of course welcome a pull request that adds support.

@youroff
Copy link
Author

youroff commented Jan 12, 2013

Well. I just upped the dependency versions for active_support and action_pack locally and It works. But I'm not sure that it's legitimate and reliable way, so I would aware of making a pull request with these changes.

@jodosha
Copy link
Member

jodosha commented Jan 18, 2013

@youroff I haven't investigated yet, but I've seen most of the methods to accept an optional argument options. https://github.com/rails/rails/blob/master/activesupport/lib/active_support/cache.rb#L274

Which kinda sucks because it creates an infinite protocol.

@youroff
Copy link
Author

youroff commented Jan 18, 2013

Isn't it the same in current stable release? Anyway, I use it only as a session storage. Do you think it's ok?

@jodosha
Copy link
Member

jodosha commented Jan 18, 2013

Yeah, just noticed. I upgrated tests to Rails 3.2.x and they're passing. Another reason why having that option = nil everywhere sucks.

@bricker
Copy link

bricker commented Apr 18, 2013

For what it's worth, I have been using redis-store with rails 4 successfully for a while now, with no modifications to the actual source. Granted, I'm only using it in very basic ways (pretty much just the cache helper).

Here's what I did:

I forked this repo, and bumped up the the gem dependencies in a few of the gemspecs:

  • redis-actionpack: 'actionpack', '>= 3.2.3'
  • redis-activesupport: 'activesupport', '>= 3.2.3'
  • redis-rack: 'rack', '~> 1.5.2'

The two commits are 7995257 and 99aa42f .

And then, in my Gemfile, I just need to use those forks:

gem 'redis-store', github: "bricker/redis-store"
gem 'redis-actionpack', github: "bricker/redis-store"
gem 'redis-activesupport', github: "bricker/redis-store"
gem 'redis-rack', github: "bricker/redis-store"

Anybody is welcome to use my forks, of course, but I have no intention of maintaining or updating these at all - this is a temporary workaround so that I could get Redis working with Rails 4 beta.

@nathantsoi
Copy link

Thx @bricker, I've cleaned up the great work everyone has done on these projects to create an updated set of gems for Rails 4. Specifically, I'm using them to serialize Rails 4 sessions into Redis as JSON.

https://github.com/nathantsoi/redis-store-json

@tisba
Copy link

tisba commented Jul 2, 2013

What's the status on this? 507935e incorporates the change to require 'activesupport in >= 3.2.3'. Simply using master should work just fine (I gave it a shot, no problems so far).

@jodosha any issues that prevents you from making a release?

@jodosha
Copy link
Member

jodosha commented Jul 19, 2013

@tisba @nathantsoi I'm looking for help for close these tickets, and release the gems. Do you wanna contribute?

@nathantsoi
Copy link

happy to help, not sure what the question is though? as @tisba said, seems like 507935e takes care of the compatibility issue?

@tisba
Copy link

tisba commented Jul 19, 2013

what @nathantsoi said, not sure what to do about this issue otherwise…

@jodosha
Copy link
Member

jodosha commented Jul 21, 2013

@tisba @nathantsoi that commit only enables Travis CI build to be run against Rails 4, but the production code isn't there yet.

@msokk
Copy link

msokk commented Aug 5, 2013

Hi,

what's the status of this.
I get "FiberError - can't yield from root fiber:" with Ruby 2.0

@amacneil
Copy link

+1

@msokk
Copy link

msokk commented Aug 28, 2013

It's working for me now, as Rails 4 support has been released. Fiber error was caused by websocket-rails.

@jodosha
Copy link
Member

jodosha commented Aug 28, 2013

Released a few days ago. http://rubygems.org/gems/redis-rails

@jodosha jodosha closed this as completed Aug 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants