I installed a new gem needle in my rails 3.1.
It installed properly but when I start my rails using command rails server --debugger
I get the following warnings:
.rvm/gems/ruby-1.9.2-p290/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining `initialize' may cause serious problems
.rvm/gems/ruby-1.9.2-p290/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining 'object_id' may cause serious problems
.rvm/gems/ruby-1.9.2-p290/gems/needle-1.3.0/lib/needle/definition-context.rb:36: warning: undefining '__send__' may cause serious problems
How can I get rid of it?
The problem is within the needle gem itself. It does this:
But in Ruby 1.9, the
public_instance_methodsmethod returns objects of theSymbolvariety, notString. So what happens is effectively this:When it should be NOT removing those methods in the provided
Array.This indicates to me that the library hasn’t been updated (or at least tested) for Ruby 1.9. I would recommend finding where the code is for this library, forking it and then applying a patch that converts the array to symbols using something like
map(&:to_sym)to fix this problem.But be aware: there may be other cases where these differences between 1.8 and 1.9 are present.