-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error installing ffi: ERROR: Failed to build gem native extension. (Apple M1) #937
Comments
|
Same error on Catalina. Development tools are already installed.
Ruby version:
Log:
On my system, |
It seems that the build script is using the wrong include directory - universal-darwin19 instead of universal-darwin20. Creating a link for that directory fixed the issue for me.
|
|
i hot same error how to fix it |
Thanks! In my case it was creating a link universal-darwin21 which directs to universal-darwin22
|
Having the same issue. Adding the symlink did not work.
Removing the space in the pathname solved my issue. |
Solved by removing any whitespace character as pointed out by @funky-monkey
PS: I'm on an Mac Intel, so I don't think it's related to different chip architectures |
How can I know wich directory i need include? |
Here's what I did, this might help you @mareFernando03 :
I hope this can help some people. |
I have a user who ran into this issue today on his Mac M1 based computer. The only steps that were required to fix this were running xcode-select --install and bundle install again. |
ok so i figured it out i had to do |
If you encounter the error "An error occurred while installing ffi (1.15.5), and Bundler cannot continue" while running the command npx react-native@latest init AwesomeProject, try initializing your project in a folder directory without spaces. For example, run npx react-native init on the "Desktop" directory, which usually doesn't have spaces in its path. This should resolve the issue. |
This work on my 2015 mac pro |
Mac M1 you need run this command:
|
check if there is any space in you root folder name or the folder its inside , remove that space and try again |
In my case, the path didn't have any spaces, I just had to run However, if you encounter a message like this:
try checking if there aren't any available updates to it in the System Settings. If you do install updates, please restart your computer. |
This works, I got confused on last 4th point, so adding it
|
You might get
|
@lanrehnics, you are right. I also got |
Disclaimer !! You have to be careful with the next decisions I was actually getting an error even after doing that, then I had to install another version of ruby using home brew.
For M1, M2
For Intel
The 3.2.0 in the command above assumes Homebrew installed a Ruby version that starts with 3.2. If it installed a different version, replace 3.2 with the first two digits of your Ruby version. Then "refresh" your shell for these changes to take effect:
Or you can open a new terminal tab, or quit and restart Terminal. Replace .zshrc with .bash_profile if you are using Bash. If you're not sure, read my guide to find out which shell you're using. To check that you're now using the non-system version of Ruby, you can run the following commands:
It should not be
It should be 3.2.+ or later. Once you have this new version of Ruby installed, you can now install bundler (or any other gem): I then install cocoa pod and everything has been okay since then . |
Ran into this error again today, updating X-Code Command Line Tools by running |
Ran into this same issue. Here's how I fixed mine.
This should fix the issue |
l]] |
this actually works, but my question is arent we supposed to be using brew for all this? instead of system? |
Thanks, this work fine for me |
|
This worked for me. |
In a previous commit [1], we switched to using the built-in FFI provided with the `ffi` Ruby gem to avoid problems with upgrades to the system FFI breaking the gem. However, this doesn't always work because the built-in FFI implementation doesn't always build correctly, dependent on the system compiler. For example, many M1 Macs with a recent XCode installation are seeing odd failures since 2022 [2]. In this commit, the switch to use `--disable-system-ffi` is reveted; however, we still won't be using the system FFI. Instead, we will take advantage of the fact that we use a `Brewfile` and have Homebrew install a stable `libffi` version for us. [1] https://gitlab.com/gitlab-org/gitlab-development-kit/-/merge_requests/3061 [2] ffi/ffi#937
I tried removing whitespaces manually, but to no avail. This tip of @chrisvasselli fixed the issue for me: brew uninstall --ignore-dependencies pkg-config
brew install pkg-config |
The text was updated successfully, but these errors were encountered: