Open tauqs opened 7 years ago
@tauqueer28 The issue is caused by the require bson
statement.
The ===
and ==
are overwritten by the bson\specialized.rb
when comparing the nil with an rubypython internal object error occurred due to the absense of class
property of RubyPython
object.
My suggestion is to file a issue/question firstly in bson (I do have concern of bson's above behavior) and ask for narrowing down the side effect of overwriting the global operators.
Thanks Peter
Rubypython.start doesn't work when bson gem is present in the requirements.
This is the code that I wrote:
require 'rubypython' require 'bson'
RubyPython.start sys = RubyPython.import("sys") p sys.path RubyPython.stop
When I run this code, Rubypython.start generates following error:
/usr/local/rvm/rubies/ruby-2.2.5/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/tauq/Documents/Oz/Tauqueer/cluster1/cluster.rb /usr/local/rvm/gems/ruby-2.2.5/gems/rubypython-0.6.4/lib/rubypython/pymainclass.rb:50:in'
method_missing': undefined method
class' for <module 'main' (built-in)>:RubyPython::PyMainClass (NoMethodError) from /usr/local/rvm/gems/ruby-2.2.5/gems/bson-4.2.2/lib/bson/specialized.rb:36:in==' from /usr/local/rvm/gems/ruby-2.2.5/gems/rubypython-0.6.4/lib/rubypython.rb:219:in
===' from /usr/local/rvm/gems/ruby-2.2.5/gems/rubypython-0.6.4/lib/rubypython.rb:219:inblock in notify' from /usr/local/rvm/gems/ruby-2.2.5/gems/rubypython-0.6.4/lib/rubypython.rb:218:in
each' from /usr/local/rvm/gems/ruby-2.2.5/gems/rubypython-0.6.4/lib/rubypython.rb:218:innotify' from /usr/local/rvm/gems/ruby-2.2.5/gems/rubypython-0.6.4/lib/rubypython.rb:77:in
block in start' from /usr/local/rvm/gems/ruby-2.2.5/gems/rubypython-0.6.4/lib/rubypython/python.rb:11:insynchronize' from /usr/local/rvm/gems/ruby-2.2.5/gems/rubypython-0.6.4/lib/rubypython/python.rb:11:in
synchronize' from /usr/local/rvm/gems/ruby-2.2.5/gems/rubypython-0.6.4/lib/rubypython.rb:54:instart' from /Users/tauq/Documents/Oz/Tauqueer/cluster1/cluster.rb:3:in
<top (required)>' from -e:1:inload' from -e:1:in
Process finished with exit code 1
========================================================================
This won't happen if I don't use bson gem. Please look into the issue.