ffi: cannot load such file -- ffi_c (LoadError)
Hi,
Today I have updated ruby version to 2.1.3 in windows OS and try to run a simple watir script & I came across this issue.
C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': ca
nnot load such file -- ffi_c (LoadError)
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/ffi-1.9.3-x86-mingw32/lib/ffi.rb
:14:in `rescue in <top (required)>'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/ffi-1.9.3-x86-mingw32/lib/ffi.rb
:3:in `<top (required)>'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/childprocess-0.5.3/lib/childproc
ess/windows.rb:1:in `<top (required)>'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/childprocess-0.5.3/lib/childproc
ess.rb:176:in `<top (required)>'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.43.0/lib/se
lenium/webdriver.rb:1:in `<top (required)>'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.43.0/lib/se
lenium-webdriver.rb:1:in `<top (required)>'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/watir-webdriver-0.6.10/lib/watir
-webdriver.rb:2:in `<top (required)>'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from tests.rb:2:in `<main>'
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 23 (10 by maintainers)
gem install ffi --platform=ruby fixed for me
@luislavena
Well, sorry it works. But I also think I have to think about stop developing ruby application on Windows.
gem:2.6.11 ruby:ruby 2.0.0p648 (2015-12-16) [x86_64-linux] CentOS Linux release 7.2.1511 (Core) I still have this problem use --platform=ruby didn’t slove my problem
@chaoli46
I’m not sure how or what to answer to that. If you have experience dealing with Linux (bash, compilation and a ton of other knowledge), then by all means go ahead and run Ruby on that environment. Whatever makes you happy.
At some point you will need to gain that experience, if is not dealing with this gem and its dependencies, will be with others and related services, tools, etc.
There is no such thing as perfect OS or programming language.
As most open-source development and support goes, everything is given by good will and in our free time (at least I’m not paid to work on it).
A community is build around positive and constructive feedback and contributions. Not sure how to deal with passive-aggresive comments or how those can improve all the above.
Addng
gem "ffi"
to myGemfile
fixed it https://stackoverflow.com/q/65000467/12544391gem install ffi --pre This worked for me under windows
@anilreddy @chaoli46 please read the Rubyinstaler announcement notes:
https://groups.google.com/d/topic/rubyinstaller/AnVOc_cosTw/discussion
That means you need to do:
gem install ffi --platform=ruby
to trigger compilation.It will take time for gems to bundle binaries for Ruby 2.1, so please be patient.
@tduehr I have this issue still . I tried “gem -rdevkit install ffi --platform=ruby ffi” but it throws error saying -rdevkit is an Invalid option .
I have “ruby 2.2.1p85 (2015-02-26 revision 49769) [i386-mingw32]” . I am completely new to ruby , Please tell me if i am in the right way .