【问题标题】:Ruby 2.7.0 in termux - FFI:NotFoundErrortermux 中的 Ruby 2.7.0 - FFI:NotFoundError
【发布时间】:2023-03-21 19:05:01
【问题描述】:

我的问题是关于在 termux 上使用 Ruby 2.7.0(通过 rbenv 构建):-

我看到了:-

FFI::NotFoundError: Function 'getdtablesize' not found in [libc.so] 当我尝试运行 rake 时,我已经在网上搜索过,但到目前为止还没有找到很多关于这个错误的信息。

堆栈跟踪:-

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'```

【问题讨论】:

    标签: ruby ffi rbenv termux lineageos


    【解决方案1】:

    似乎getdtablesize 函数(由 ethon gem 使用)已从最近的 Android 发行版的 libc 中删除,显然是在一段时间后被 deprecated 删除。

    因此,要在您的 Android 发行版中使用 ethon gem,您需要:

    • 使 gem 不再使用 getdtablesize 函数,或者
    • 为您的项目使用不同的 libc,它仍然提供该功能,例如libc of the GNU project

    【讨论】:

    猜你喜欢
    • 2021-10-08
    • 2020-06-06
    • 1970-01-01
    • 2020-06-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-16
    • 2022-01-13
    相关资源
    最近更新 更多