DBI Row / delegate behavior between ruby 1.8.7 and 2.1

╄→гoц情女王★ 提交于 2019-12-04 14:22:47

Ran into the same issue, tracked down the problem.

Find lib/dbi/row.rb in the gem directory. Line 212 or thereabouts should read

        if RUBY_VERSION =~ /^1\.9/

Edit it to be

        if RUBY_VERSION =~ /^1\.9/ || RUBY_VERSION =~ /^2/

This too, was a problem we had with code written with Ruby 1.8x , when run in 2.1.0 it coughed up /usr/lib/ruby/2.1.0/delegate.rb:392:in __getobj__': not delegated (ArgumentError) from /usr/lib/ruby/2.1.0/delegate.rb:341:inblock in delegating_block'

Once we found jsc comment above, we altered the file row.rb in the dbi gem folder. Again, looking for the part of:

 if RUBY_VERSION =~ /^1\.9/

and update it to

if RUBY_VERSION =~ /^1\.9/ || RUBY_VERSION =~ /^2/

After that, the app ran without a problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!