blackswan
Activity Graph
Page 1 of 1
2019-02-14
2019-02-13
[19:35:53]
blackswan:
i am trying to use rails in Perl. don't ask why, it's not safe for you to know.
[19:37:05]
blackswan:
it's complaining "Subroutine new redefined at (eval 324) line 518." for some deprecated OpenSSL classes
[19:38:48]
blackswan:
it's complaining this because it (meaning the Perl Inline::Ruby module) is trying to redefine 'new' for the Ruby class (i think), but it is also finding that the Ruby code it ran has defined a method named 'new'. so it's generating a string to be eval'ed by ruby that contains two different definitions of 'new'
[19:40:16]
blackswan:
it *does* override 'initialize', and the Inline::Perl isn't seeing that in the list of symbols it thinks got defined when the OpenSSL Ruby code was loaded.
[19:41:14]
blackswan:
is there some magic internally in the ruby code i should be looking for that might be taking the fact that this openssl code overrides the 'initialize' method and turning it into something that Inline::Perl is thinking is it overriding the 'new' method?
[19:41:47]
blackswan:
grepping for 'initialize' and 'new' would be difficult, so i thought i'd ask in the hopes that somebody who knows more about ruby internals would hear my plea and take pity on me
[19:42:10]
blackswan:
i mean, grepping would be easy finding the lines i'm looking for wouldn't be easy.
[19:42:55]
blackswan:
so something is different and i am trying to understand what it is so i can determine whether it is a problem and make it stop warning me about it.
[19:46:02]
blackswan:
it looks at the ruby namespace before and after it evaluates ruby code, and finds new definitions of methods and instance methods, and defines perl counterparts.
[19:47:08]
blackswan:
it's skipping a method named 'new' from ruby if it finds it as a class method but not if it finds it as an instance method.
[20:22:04]
blackswan:
it's because Digest::Base, Digest::Class, and Digest::Instance define an instance method named 'new'.
2019-02-12
[01:26:09]
blackswan:
i am trying to use perl's Inline::Ruby and it seems to be dying from a NoMethodError because the Ruby module IO::generic_writable doesn't have instance_methods defined
[12:45:21]
blackswan:
i'm having a weird problem with a Module that doesn't appear to have the instance_methods method defined.
[12:46:34]
blackswan:
i'm still trying to get it simplified enough to paste. i'm using ruby embedded in perl with the Inline::Ruby perl module.
[12:51:21]
blackswan:
it is getting this from a list of modules that get defined, and then it is trying to call methods and instance_methods on those modules
[12:51:56]
blackswan:
it fails on IO::generic_writeable and IO::generic_readable, which are magic methods from ext/stringio/stringio.c in the ruby source.
[12:52:30]
blackswan:
so i can't tell if this is a bug in ruby or in the Inline::Ruby module or something else because i am unfamiliar with the code.
[13:01:28]
blackswan:
it's setting k to "IO::generic_writable" and doing eval "#{k}.instance_methods"
[13:02:04]
blackswan:
yes, when i access it from StringIO::included_modules i get an instance_methods method, that's what is confusing.
[13:08:16]
blackswan:
what it's doing is it's trying to figure out what ruby objects were created after running a chunk of ruby code so that those objects can be made visible to Perl.
[13:14:52]
blackswan:
maybe i didn't see what i thought i saw. it's possible it was always failing on calling methods. i'm not sure any more.
[13:29:24]
blackswan:
ok. i've come to the tentative conclusion that the NoMethodError is misleading. it's a NoMethodError because there's no method, but there's no method because it can't access IO::generic_readable or IO::generic_writable by their names for some reason, and it's throwing NoMethodError instead of NameError because reasons.
2018-12-16
2018-12-14
2018-12-13
2018-12-12
2018-12-11
2018-12-10
2018-12-09
2018-12-08
2018-12-07
2018-12-06
2018-12-05
2018-12-04
2018-12-03
[20:10:26]
blackswan:
use Inline 'Ruby' => 'require "rails"'; yields #<ArgumentError: unknown encoding name: binary> while trying to load a ruby file with coding: binary
[22:42:31]
blackswan:
now i'm getting #<TypeError: no implicit conversion of NoMethodError into String> when i do use Inline 'Ruby' => 'require "rails"';
2013-11-08
[11:09:39]
blackswan:
is anybody around who can quickly answer stupid neophyte rails questions about how "rake db:migrate" works under the hood, or point me to some enlightening web page?