Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iconv will be deprecated in the future, use String#encode instead

Am getting the following deprecated warnings with ruby 1.9.3-p125 when i run rspec. But there are no deprecated warnings with ruby 1.9.2.

/gems/ruby-1.9.3-p125@cs/gems/soap4r-1.5.8/lib/xsd/iconvchars
et.rb:9:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead.
/home/ec2-user/.rvm/gems/ruby-1.9.3-p125@cs/gems/hpricot-0.8.2/lib/hpricot/build
er.rb:2:in `require': /gems/ruby-1.9.3-p125@cs/gems/hpricot-0
.8.2/lib/fast_xs.so: undefined symbol: ruby_digitmap - /gems/
ruby-1.9.3-p125@cs/gems/hpricot-0.8.2/lib/fast_xs.so (LoadError)

What could be the cause here? Can someone please help with this.

like image 574
diya Avatar asked Aug 04 '26 21:08

diya


2 Answers

There is a proposal for ruby 1.9.3 to move stdlibs to gems. As part of this transition transcoding between different string-encodings will be "gemified", see the Wiki (section: What stdlibs should be gemified?).

Therefore every time iconv is called, the deprecation-notice will be shown, in order to notify devs that future versions of ruby won't use lib/iconv and tell them that (and where) a code modification is necessary to account for these planned changes.

For now this is not problematic, as both iconv and String#encode will be supported in order to give devs time to make the transition. but you should keep in mind, that your code will break in future versions if you don't switch out the deprecated code.

A quick Google search will help you make the transition, e.g. "From Iconv#iconv to String#encode", if necessary. if you don't plan to make that change you should stay away from future versions and be extra careful when updating your env.

like image 166
dbrumann Avatar answered Aug 07 '26 15:08

dbrumann


The log entry tells you that the problem is generated in the soap4r gem. It looks like the gem was not updated for a while, version 1.5.8 is from year 2007 So it may also have other problems with ruby 1.9.3.

There is a project that claims to have a ruby-1.9 compatible version: soap4r-ruby1.9

There are also other soap libraries for ruby, here you see some of them: ruby-toolbox search for soap

like image 27
Meier Avatar answered Aug 07 '26 17:08

Meier



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!