Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ethon: NoMethodError: undefined method `enum' for Ethon::Curl:Module #1524

Closed
deepj opened this issue Dec 9, 2018 · 4 comments
Closed

ethon: NoMethodError: undefined method `enum' for Ethon::Curl:Module #1524

deepj opened this issue Dec 9, 2018 · 4 comments
Assignees
Milestone

Comments

@deepj
Copy link

deepj commented Dec 9, 2018

It seems, in this case it looks on a problem with metaprogramming and extending modules.

To reproduce

require 'ethon'

Error:

NoMethodError: undefined method `enum' for Ethon::Curl:Module
	from ~/.gem/truffleruby/2.4.4/gems/ethon-0.11.0/lib/ethon/curls/constants.rb:16:in `Curl'
	from ~/.gem/truffleruby/2.4.4/gems/ethon-0.11.0/lib/ethon/curls/constants.rb:2:in `Ethon'
	from ~/.gem/truffleruby/2.4.4/gems/ethon-0.11.0/lib/ethon/curls/constants.rb:1:in `<top (required)>'
	from ~/.rubies/truffleruby-1.0.0-rc10/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `gem_original_require'
	from ~/.rubies/truffleruby-1.0.0-rc10/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	from ~/.gem/truffleruby/2.4.4/gems/ethon-0.11.0/lib/ethon/curl.rb:26:in `Curl'
	from ~/.gem/truffleruby/2.4.4/gems/ethon-0.11.0/lib/ethon/curl.rb:13:in `Ethon'
	from ~/.gem/truffleruby/2.4.4/gems/ethon-0.11.0/lib/ethon/curl.rb:8:in `<top (required)>'
	from ~/.rubies/truffleruby-1.0.0-rc10/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `gem_original_require'
	from ~/.rubies/truffleruby-1.0.0-rc10/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	from ~/.gem/truffleruby/2.4.4/gems/ethon-0.11.0/lib/ethon.rb:15:in `<top (required)>'
	from ~/.rubies/truffleruby-1.0.0-rc10/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:130:in `gem_original_require'
	from ~/.rubies/truffleruby-1.0.0-rc10/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:130:in `require'
	from (irb):3
	from ~/.rubies/truffleruby-1.0.0-rc10/bin/irb:29:in `<main>'
@Vad1mo
Copy link

Vad1mo commented Dec 16, 2018

I am facing a similar or same problem

Possibly unsupported Ruby implementation
/Users/v/.rvm/gems/truffleruby-1.0.0-rc10/gems/ethon-0.9.0/lib/ethon/curls/constants.rb:16:in `Curl': undefined method `enum' for Ethon::Curl:Module (NoMethodError)

Is there any workaround?

@deepj
Copy link
Author

deepj commented Dec 18, 2018

@Vad1mo I doubt there is one. It looks an issue in TruffleRuby interpreter. Maybe @eregon could know more and what he thinks about this.

@eregon
Copy link
Member

eregon commented Jan 20, 2019

I'm looking at improving our FFI implementation, which is currently fairly minimal and causing this, see #1529. I'll keep this issue open to make sure require "ethon" works.

@eregon
Copy link
Member

eregon commented Apr 18, 2019

I fixed this in 59fb511 and added complete support for the FFI, with a pure-Ruby implementation using Truffle NFI.
I checked and require "ethon" now works.
It will be in the next release (1.0.0-rc16).
Thank you for the report.

@eregon eregon closed this as completed Apr 18, 2019
@eregon eregon added this to the 1.0.0-rc16 milestone Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants