简体   繁体   English

如何在M1芯片上成功安装ffi 1.9.25

[英]How to install ffi 1.9.25 successfully on M1 Chip

An error occurred while installing ffi (1.9.25), and Bundler cannot continue.

In Gemfile:
  bootstrap-sass was resolved to 3.3.7, which depends on
    sass was resolved to 3.7.4, which depends on
      sass-listen was resolved to 4.0.0, which depends on
        rb-inotify was resolved to 0.10.1, which depends on
          ffi

I'm running into this issue on an M1 laptop for a rails project I'm running bundle install , how to resolve this?我在运行bundle install的 Rails 项目的 M1 笔记本电脑上遇到了这个问题,如何解决这个问题?

I tried running我试着跑步

gem install ffi -v '1.9.25' -- --with-cflags="-Wno-error=implicit-function-declaration" gem install ffi -v '1.9.25' -- --with-cflags="-Wno-error=implicit-function-declaration"

Which installed the gem successfully, but when I try to run rake db:migrate this error comes up哪个成功安装了 gem,但是当我尝试运行rake db:migrate时出现此错误

rake db:migrate                                                                                                                
rake aborted!
LoadError: dlopen(/Users/kanye.west/.rbenv/versions/2.6.9/lib/ruby/gems/2.6.0/gems/ffi-1.9.25/lib/ffi_c.bundle, 0x0009): symbol not found in flat namespace (_ffi_prep_closure) - /Users/kanye.west/.rbenv/versions/2.6.9/lib/ruby/gems/2.6.0/gems/ffi-1.9.25/lib/ffi_c.bundle
/Users/kanye.west/dev/anenta/config/application.rb:14:in `<top (required)>'
/Users/kanye.west/dev/anenta/Rakefile:5:in `require'
/Users/kanye.west/dev/anenta/Rakefile:5:in `<top (required)>'
/Users/kanye.west/.rbenv/versions/2.6.9/bin/bundle:23:in `load'
/Users/kanye.west/.rbenv/versions/2.6.9/bin/bundle:23:in `<main>'

Install ffi gem with below command使用以下命令安装 ffi gem

gem install ffi -v '1.9.25' -- --with-cflags="-Wno-error=implicit-function-declaration"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM