- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用适用于 Linux 的 Windows 子系统 (WSL) 在我的 Windows 机器上启动并运行一个(私有(private))Ruby on Rails 应用程序。我能够在没有任何错误的情况下运行 bundle install
但现在当我运行 rails apartment:create
时出现错误:
LoadError:libffi.so.8:无法打开共享对象文件:没有这样的文件或目录 -/home/myDirectory/.rvm/gems/ruby-2.5.7/gems/ffi-1.11.1/lib/ffi_c .so
完整错误如下。
我尝试使用 rvm get head
和 rvm reinstall 2.5.7
重新安装 ruby,使用 gem uninstall ffi
和 gem 重新安装 ffi安装 ffi -v 1.11.1
,并使用 ln -s libffi.so.8 libffi.so.1.8
创建符号链接(symbolic link),但得到相同的结果。
还有什么我可以尝试的吗?
me@LAPTOP-xyz:/mnt/c/Users/me/Documents/app/Application/master$ rails apartment:create
rails aborted!
LoadError: libffi.so.8: cannot open shared object file: No such file or directory - /home/me/.rvm/gems/ruby-2.5.7/gems/ffi-1.11.1/lib/ffi_c.so
/home/me/.rvm/gems/ruby-2.5.7/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
/home/me/.rvm/gems/ruby-2.5.7/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/home/me/.rvm/gems/ruby-2.5.7/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/me/.rvm/gems/ruby-2.5.7/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
/home/me/.rvm/gems/ruby-2.5.7/gems/ffi-1.11.1/lib/ffi.rb:6:in `rescue in <top (required)>'
/home/me/.rvm/gems/ruby-2.5.7/gems/ffi-1.11.1/lib/ffi.rb:3:in `<top (required)>'
/mnt/c/Users/me/Documents/app/Application/master/config/application.rb:18:in `<top (required)>'
/mnt/c/Users/me/Documents/app/Application/master/rakefile:4:in `require_relative'
/mnt/c/Users/me/Documents/app/Application/master/rakefile:4:in `<top (required)>'
/home/me/.rvm/gems/ruby-2.5.7/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:22:in `block in perform'
/home/me/.rvm/gems/ruby-2.5.7/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/me/.rvm/gems/ruby-2.5.7/gems/railties-5.2.3/lib/rails/command.rb:48:in `invoke'
/home/me/.rvm/gems/ruby-2.5.7/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
/mnt/c/Users/me/Documents/app/Application/master/bin/rails:9:in `require'
/mnt/c/Users/me/Documents/app/Application/master/bin/rails:9:in `<top (required)>'
/home/me/.rvm/gems/ruby-2.5.7/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
/home/me/.rvm/gems/ruby-2.5.7/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
/home/me/.rvm/gems/ruby-2.5.7/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
/home/me/.rvm/gems/ruby-2.5.7/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
/home/me/.rvm/gems/ruby-2.5.7/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
/home/me/.rvm/gems/ruby-2.5.7/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
/home/me/.rvm/gems/ruby-2.5.7/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
/mnt/c/Users/me/Documents/app/Application/master/bin/spring:15:in `require'
/mnt/c/Users/me/Documents/app/Application/master/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Caused by:
LoadError: cannot load such file -- 2.5/ffi_c
/home/me/.rvm/gems/ruby-2.5.7/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
/home/me/.rvm/gems/ruby-2.5.7/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/home/me/.rvm/gems/ruby-2.5.7/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/me/.rvm/gems/ruby-2.5.7/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
/home/me/.rvm/gems/ruby-2.5.7/gems/ffi-1.11.1/lib/ffi.rb:4:in `<top (required)>'
/mnt/c/Users/me/Documents/app/Application/master/config/application.rb:18:in `<top (required)>'
/mnt/c/Users/me/Documents/app/Application/master/rakefile:4:in `require_relative'
/mnt/c/Users/me/Documents/app/Application/master/rakefile:4:in `<top (required)>'
/home/me/.rvm/gems/ruby-2.5.7/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:22:in `block in perform'
/home/me/.rvm/gems/ruby-2.5.7/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/me/.rvm/gems/ruby-2.5.7/gems/railties-5.2.3/lib/rails/command.rb:48:in `invoke'
/home/me/.rvm/gems/ruby-2.5.7/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
/mnt/c/Users/me/Documents/app/Application/master/bin/rails:9:in `require'
/mnt/c/Users/me/Documents/app/Application/master/bin/rails:9:in `<top (required)>'
/home/me/.rvm/gems/ruby-2.5.7/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
/home/me/.rvm/gems/ruby-2.5.7/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
/home/me/.rvm/gems/ruby-2.5.7/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
/home/me/.rvm/gems/ruby-2.5.7/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
/home/me/.rvm/gems/ruby-2.5.7/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
/home/me/.rvm/gems/ruby-2.5.7/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
/home/me/.rvm/gems/ruby-2.5.7/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
/mnt/c/Users/me/Documents/app/Application/master/bin/spring:15:in `require'
/mnt/c/Users/me/Documents/app/Application/master/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
(See full trace by running task with --trace)
最佳答案
我不确定您当前的设置是什么,但我最近遇到了与 WSL 错误类似的问题。
对于我,我认为问题是在我通过 Homebrew for Linux 安装 ffmpeg
时出现的。在执行 brew install ffmpeg
时,我相信它添加了一个 brew install ffi
作为其依赖项的结果,导致我的系统上的某些东西随着关于 FFI。
在重新安装(通过 rbenv
)几次都无济于事之后,我终于做了一个 brew uninstall ffi --ignore-dependencies
然后做了另一个rbenv 安装 2.7.4
。
在此之后,我能够成功地 gem install llhttp-ffi -v 0.4.0
而我之前无法做到,因为您收到的错误消息相同。
抱歉,除了与您有相同的错误外,没有任何其他细节。希望您能指出正确的方向。
关于ruby-on-rails - 如何解决 "LoadError: cannot load such file -- 2.5/ffi_c"Running Ruby on Rails with WSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69740540/
这个问题困扰了我几天...每当我使用 .bring_to_front 方法时 require "rubygems" require "watir" browser = Watir::Browser::
我尝试运行一个简单的脚本,如下所示,以使用 watir-webdriver 和 Ruby 学习自动化。但是我没有得到这样的类错误-ffi_c。 class TestWatir require 'w
我想知道如何解决在安装 Ruby 2.2.1 Windows 安装程序和 Ruby gem 2.4 后在控制台上执行 require 命令时看到的下一个错误.6。 LoadError: cannot
我正在尝试使用适用于 Linux 的 Windows 子系统 (WSL) 在我的 Windows 机器上启动并运行一个(私有(private))Ruby on Rails 应用程序。我能够在没有任何错
当我尝试使用 pod install 安装模块时目录中的命令 ios react native 项目,我收到以下错误: LoadError - incompatible library version
我是一名优秀的程序员,十分优秀!