GithubHelp home page GithubHelp logo

Comments (4)

ezmobius avatar ezmobius commented on June 27, 2024

Don't use redis with sinatra in default sinatra mode. You will have to use Sinatra::Application to contain your sintra apps to keep them from poluting the global namespace and fubaring redis.

from redis-rb.

pzingg avatar pzingg commented on June 27, 2024

Unfortunately I'm using a framework within a framework. My application is a subclass of Padrino::Application, which is a subclass of Sinatra::Application. The errors came within the padrino "controllers" which are simply instance_evals within the application class that call "get" and "delete". My redis#get and redis#delete calls are inside of these routing statements, which call methods in an instance of Usher::Interface::Rack::Builder, the routing code. Somehow the redis#get and redis#delete end up somewhere else.trying to call the Rack::Builder methods. I guess I'll stick with my get and delete patch to redis until I can spend enough time to figure out what ruby is doing when it tries to resolve these "get" and "delete" method calls.

from redis-rb.

ezmobius avatar ezmobius commented on June 27, 2024

I don't understand how this works. is sinatra defining 'get' and 'set' in the Kernel or Object namespace or something? If so thats pretty gross :( I'd rather not patch redis-rb to work around a sintra bug that should probabky be fixed in sinatra.

But perhaps we could add an extra file sinatra_safe.rb with your patches that allow you to require this if you really need it? Not sure whats best here

from redis-rb.

pzingg avatar pzingg commented on June 27, 2024

I don't understand it either. So I don't recommend doing anything to your code base until I find out the mechanism involved. It might be that I have to add "::" or something somewhere in my application code.

from redis-rb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.