You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Jason Frey (JIRA)" <ji...@apache.org> on 2017/07/18 15:43:01 UTC

[jira] [Commented] (PROTON-1519) qpid_proton 0.17.0 Ruby gem does not work with Ruby 2.4.1

    [ https://issues.apache.org/jira/browse/PROTON-1519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16091731#comment-16091731 ] 

Jason Frey commented on PROTON-1519:
------------------------------------

I think I see the issue.  In Ruby 2.4, Fixnum and Bignum classes have been merged into the Integer class.  The code is [created a mapping https://github.com/apache/qpid-proton/blob/10df4133e8877ee535e24b494738356369dcd24c/proton-c/bindings/ruby/lib/codec/mapping.rb#L99] for both classes but Ruby resolves those classes to the same class.  When [placed into the Hash https://github.com/apache/qpid-proton/blob/10df4133e8877ee535e24b494738356369dcd24c/proton-c/bindings/ruby/lib/codec/mapping.rb#L55], the code see a duplicate and fails.

I'll put in a pull request for this fix as it seems pretty straightforward.

> qpid_proton 0.17.0 Ruby gem does not work with Ruby 2.4.1
> ---------------------------------------------------------
>
>                 Key: PROTON-1519
>                 URL: https://issues.apache.org/jira/browse/PROTON-1519
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: ruby-binding
>    Affects Versions: 0.17.0
>         Environment: Ruby 2.4.1 on macOS Sierra 10.12.5
>            Reporter: Jason Frey
>            Assignee: Alan Conway
>
> qpid_proton 0.17.0 was built successfully from source with
> {code}
> > cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DLIB_INSTALL_DIR=/usr/local/lib
> > make install
> {code}
> Installing the gem with Ruby 2.4.1 from rubygems.org was successful
> {code}
> > gem install qpid_proton
> Building native extensions.  This could take a while...
> Successfully installed qpid_proton-0.17.0
> 1 gem installed
> {code}
> However, using the gem fails with: "RuntimeError: entry exists for Integer"
> {code}
> > irb
> [1] pry(main)> RUBY_DESCRIPTION
> => "ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin15]"
> [2] pry(main)> require 'qpid_proton'
> /Users/jfrey/.gem/ruby/2.4.1/gems/qpid_proton-0.17.0/lib/codec/mapping.rb:99: warning: constant ::Fixnum is deprecated
> /Users/jfrey/.gem/ruby/2.4.1/gems/qpid_proton-0.17.0/lib/codec/mapping.rb:99: warning: constant ::Bignum is deprecated
> RuntimeError: entry exists for Integer
> from (qpid_proton-0.17.0) lib/codec/mapping.rb:55:in `block in initialize'
> (qpid_proton-0.17.0) lib/codec/mapping.rb:54:in `each'
> (qpid_proton-0.17.0) lib/codec/mapping.rb:54:in `initialize'
> (qpid_proton-0.17.0) lib/codec/mapping.rb:99:in `new'
> (qpid_proton-0.17.0) lib/codec/mapping.rb:99:in `<module:Codec>'
> (qpid_proton-0.17.0) lib/codec/mapping.rb:20:in `<top (required)>'
> (ruby-2.4.1) lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
> (ruby-2.4.1) lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
> (qpid_proton-0.17.0) lib/qpid_proton.rb:54:in `<top (required)>'
> (ruby-2.4.1) lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `require'
> (ruby-2.4.1) lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
> (ruby-2.4.1) lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:40:in `require'
> (pry):1:in `<main>'
> {code}
> Note that the above steps are all successful with Ruby 2.3.3
> {code}
> > irb
> [1] pry(main)> RUBY_DESCRIPTION
> => "ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin15]"
> [2] pry(main)> require 'qpid_proton'
> => true
> [3] pry(main)> Qpid::Proton
> => Qpid::Proton
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org