1

My question is regarding using Ruby 2.7.0 (built via rbenv) on termux:-

I'm seeing:-

FFI::NotFoundError: Function 'getdtablesize' not found in [libc.so] when I try and run rake, I've searched online but haven't managed to find much about this error so far.

Stack trace:-

FFI::NotFoundError: Function 'getdtablesize' not found in [libc.so]
/data/data/com.termux/files/home/Projects/myapp/.bundle/ruby/2.7.0/gems/ffi-1.11.3/lib/ffi/library.rb:273:in `attach_function'
/data/data/com.termux/files/home/Projects/myapp/.bundle/ruby/2.7.0/gems/ethon-0.12.0/lib/ethon/libc.rb:16:in `<module:Libc>'
/data/data/com.termux/files/home/Projects/myapp/.bundle/ruby/2.7.0/gems/ethon-0.12.0/lib/ethon/libc.rb:6:in `<module:Ethon>'
/data/data/com.termux/files/home/Projects/myapp/.bundle/ruby/2.7.0/gems/ethon-0.12.0/lib/ethon/libc.rb:1:in `<main>'
/data/data/com.termux/files/home/Projects/myapp/.bundle/ruby/2.7.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/data/data/com.termux/files/home/Projects/myapp/.bundle/ruby/2.7.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/data/data/com.termux/files/home/Projects/myapp/.bundle/ruby/2.7.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'```
Sleeves
  • 41
  • 4

1 Answers1

1

It seems the getdtablesize function (which is used by the ethon gem) was removed from the libc of more recent Android distributions, apparently after being deprecated for some time.

Thus, to use the ethon gem on your Android distribution, you would need to either:

  • adapt the gem to not use the getdtablesize function anymore, or
  • use a different libc for your project which still provides the function, e.g. the libc of the GNU project
Holger Just
  • 52,918
  • 14
  • 115
  • 123
  • 2
    Correct, I also arrived there! I patched it and submitted a PR to the gem - https://github.com/tevio/ethon/commit/f0b4aab081f218c51d0501e7e12fb2a177e16300 – Sleeves Feb 16 '20 at 21:40