enkessler / childprocess

Cross-platform Ruby library for managing child processes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FFI installes but rake test get error

nikolairoshchin opened this issue · comments

C:\Users\nick\Documents\ruby\work\depot>gem install ffi -v 1.15.5
Successfully installed ffi-1.15.5-x64-mingw32
Parsing documentation for ffi-1.15.5-x64-mingw32
Done installing documentation for ffi after 1 seconds
1 gem installed

C:\Users\nick\Documents\ruby\work\depot>rake test
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/childprocess-4.1.0/lib/childprocess/windows.rb:6:in rescue in <main>': FFI is a required pre-requisite for Windows or posix_spawn support in the ChildProcess gem. Ensure the ffigem is installed. If you believe this is an error, please file a bug at http://github.com/enkessler/childprocess/issues (ChildProcess::MissingFFIError) from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/childprocess-4.1.0/lib/childprocess/windows.rb:3:in

'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/childprocess-4.1.0/lib/childprocess.rb:209:in <main>' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/selenium-webdriver-4.1.0/lib/selenium/webdriver.rb:20:in '
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/selenium-webdriver-4.1.0/lib/selenium-webdriver.rb:20:in <main>' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/3.0.0/bundler/runtime.rb:60:in block (2 levels) in require'
from C:/Ruby30-x64/lib/ruby/3.0.0/bundler/runtime.rb:55:in each' from C:/Ruby30-x64/lib/ruby/3.0.0/bundler/runtime.rb:55:in block in require'
from C:/Ruby30-x64/lib/ruby/3.0.0/bundler/runtime.rb:44:in each' from C:/Ruby30-x64/lib/ruby/3.0.0/bundler/runtime.rb:44:in require'
from C:/Ruby30-x64/lib/ruby/3.0.0/bundler.rb:175:in require' from C:/Users/nick/Documents/ruby/work/depot/config/application.rb:7:in '
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:42:in require_relative' from C:/Users/nick/Documents/ruby/work/depot/config/environment.rb:2:in '
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:42:in require_relative' from C:/Users/nick/Documents/ruby/work/depot/test/test_helper.rb:2:in '
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Users/nick/Documents/ruby/work/depot/test/channels/application_cable/connection_test.rb:1:in <main>' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/test_unit/runner.rb:47:in block in load_tests'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/test_unit/runner.rb:47:in each' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/test_unit/runner.rb:47:in load_tests'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/test_unit/runner.rb:40:in run' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/commands/test/test_command.rb:33:in perform'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in run' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in invoke_command'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in dispatch' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/command/base.rb:87:in perform'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/command.rb:48:in invoke' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/commands.rb:18:in '
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from bin/rails:4:in <main>' C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in require': cannot load such file -- ffi (LoadError)
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/childprocess-4.1.0/lib/childprocess/windows.rb:4:in '
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/childprocess-4.1.0/lib/childprocess.rb:209:in <main>' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/selenium-webdriver-4.1.0/lib/selenium/webdriver.rb:20:in '
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/selenium-webdriver-4.1.0/lib/selenium-webdriver.rb:20:in <main>' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/3.0.0/bundler/runtime.rb:60:in block (2 levels) in require'
from C:/Ruby30-x64/lib/ruby/3.0.0/bundler/runtime.rb:55:in each' from C:/Ruby30-x64/lib/ruby/3.0.0/bundler/runtime.rb:55:in block in require'
from C:/Ruby30-x64/lib/ruby/3.0.0/bundler/runtime.rb:44:in each' from C:/Ruby30-x64/lib/ruby/3.0.0/bundler/runtime.rb:44:in require'
from C:/Ruby30-x64/lib/ruby/3.0.0/bundler.rb:175:in require' from C:/Users/nick/Documents/ruby/work/depot/config/application.rb:7:in '
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:42:in require_relative' from C:/Users/nick/Documents/ruby/work/depot/config/environment.rb:2:in '
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:42:in require_relative' from C:/Users/nick/Documents/ruby/work/depot/test/test_helper.rb:2:in '
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Users/nick/Documents/ruby/work/depot/test/channels/application_cable/connection_test.rb:1:in <main>' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/test_unit/runner.rb:47:in block in load_tests'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/test_unit/runner.rb:47:in each' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/test_unit/runner.rb:47:in load_tests'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/test_unit/runner.rb:40:in run' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/commands/test/test_command.rb:33:in perform'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in run' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in invoke_command'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in dispatch' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/command/base.rb:87:in perform'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/command.rb:48:in invoke' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.2.2/lib/rails/commands.rb:18:in '
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
from bin/rails:4:in `'

ChildProcess is throwing that error, yes, but it is doing so because require 'ffi' didn't work.

begin
require 'ffi'
rescue LoadError
raise ChildProcess::MissingFFIError
end

If the require statement is failing, then the problem is probably not on the ChildProcess side of things. What happens if you try to load FFI in your code before loading ChildProcess?

require 'ffi'
require 'childprocess'

hello @nikolairoshchin. Were you able to figure this out? I'm having the same issue.

hello @nikolairoshchin. Were you able to figure this out? I'm having the same issue.

Hello, unfortunately i can say nothing about it. I don't remember and have deleted sources. Sorry

childprocess gem will no longer use/requireffi as of version 5.x, which was just released.