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

Unable to save model #192

Closed
deric opened this issue Mar 13, 2015 · 2 comments
Closed

Unable to save model #192

deric opened this issue Mar 13, 2015 · 2 comments

Comments

@deric
Copy link

deric commented Mar 13, 2015

When I try to save a model, I get this error:

Redis::CommandError: ERR unknown command 'url'
redis-3.2.1/lib/redis/client.rb:113:in `call'
redis-3.2.1/lib/redis.rb:2556:in `block in method_missing'
redis-3.2.1/lib/redis.rb:37:in `block in synchronize'
monitor.rb:211:in `mon_synchronize'
redis-3.2.1/lib/redis.rb:37:in `synchronize'
redis-3.2.1/lib/redis.rb:2555:in `method_missing'
ohm-2.2.0/lib/ohm.rb:1349:in `script'
ohm.rb:1302:in `save'

The problem seems to be here

the call redis.url is causing method missing error, probably it should be something like redis.client.options.url

    # Run lua scripts and cache the sha in order to improve
    # successive calls.
    def script(file, *args)
      cache = LUA_CACHE[redis.url]

      if cache.key?(file)
        sha = cache[file]
      else
        src = File.read(file)
        sha = redis.call("SCRIPT", "LOAD", src)

        cache[file] = sha
      end

      redis.call("EVALSHA", sha, *args)
    end

However, the url doesn't have to be defined at all. What if the client is connected via an UNIX socket?

@frodsan
Copy link
Contributor

frodsan commented Mar 13, 2015

Ohm 2.0 only supports Redic. I guess you are using redis-rb.

See: https://github.com/soveran/ohm#connecting-to-a-redis-database

@deric
Copy link
Author

deric commented Mar 13, 2015

You're right, I've totally overlooked that. Thanks!

@deric deric closed this as completed Mar 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants