`require':无法加载此类文件 -- ffi (LoadError) `require':无法加载此类文件 -- 尝试启动 Rails 控制台时 ffi (LoadError)

问题描述 投票:0回答:3

完整堆栈跟踪:

/Users/galharth/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- ffi (LoadError)
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/sys-proctable-1.1.1-universal-darwin/lib/darwin/sys/proctable.rb:2:in `<top (required)>'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/sys-proctable-1.1.1-universal-darwin/lib/sys-proctable.rb:1:in `<top (required)>'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
    from /Users/galharth/Documents/productbattle/config/application.rb:7:in `<top (required)>'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:141:in `require'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:141:in `require_application_and_environment!'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:67:in `console'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /Users/galharth/.rvm/gems/ruby-2.3.0/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

Rails 版本:4.2.5 红宝石版本:2.3.0 捆绑器版本:1.10.6 OSX:El Capitan(使用 Windows 的同事)

ruby-on-rails ruby bundle
3个回答
5
投票

尝试跑步

gem install ffi --platform=ruby

请参阅此问题以获取更多见解和解决方案选项。


2
投票

我能够通过运行

ffi
并将行
gem install ffi --platform=ruby
添加到我的 Gemfile
gem 'ffi'
bundle install` 来成功安装
, and then running 
gem。


0
投票

我可以通过完全卸载 ffi gem(gem uninstall ffi),然后使用 gem install ffi --platform=ruby 重新安装来解决此问题,正如本线程中其他人所建议的那样。

© www.soinside.com 2019 - 2024. All rights reserved.