Can't Install ffi -v '1.9.18' on macos Catalina
To get past that error, install ffi using:
gem install ffi -v '1.9.18' -- --with-cflags="-Wno-error=implicit-function-declaration"
Can't install `ffi -v 1.12.2` on mac OS Monterey
I have the same issue on M1 with ffi 1.15.5
and it works if I do:
gem install ffi -v '1.15.5' -- --with-cflags=-Wno-implicit-function-declaration
Same thing goes for ffi 1.12.2
.
As far as I understand it (don't know C and googled this) - When C doesn’t find a function, it assumes it is implicitly declared and errors out. --with-cflags=-Wno-implicit-function-declaration
tells the compiler to ignore any functions that are implicitly declared.
Issues building the libffi gem native extension when trying to install Jekyll on macOS Catalina
Aaaaaand I figured it out! Credit to @ffleming here. Here's what you need to do:
- reinstall libffi on brew using
brew reinstall libffi
- add the new brew-installed libffi flags to your shell instance, e.g.
export LDFLAGS="-L/usr/local/opt/libffi/lib"
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
- Run
gem install jekyll
and you should be sorted!
Cannot install Jekyll after updating to Catalina - An error occurred while installing ffi (1.9.18)
The root problem is that you cannot install one of jekyl's dependancies - specifically the ffi gem. Knowing that will better help you workout a fix.
You can see that this is the error by reading your bundle output. Learn how to read these so you can better help yourself in the future; If you were searching for "install ffi on macOS" you might have found more information available to you.
Give that you've just installed Catalina, it's likely that GCC isn't on your machine, or is outdated, or is unlinked.
Try running xcode-select --install
to (re)install the Xcode command line tools.
ALSO - STOP USING SUDO
At the very top of your bundle output is a warning that you shouldn't use sudo
when installing gems. It's good advice to follow!
Even better advice would be to use rbenv or rvm to create gem sets or environments for each ruby application you're working with. But, if you don't go all the way down that path, ** at least, stop using sudo**
Related Topics
Rails Email Error - 530-5.5.1 Authentication Required
Having Trouble Installing Any Ruby 1.9.X (With Rbenv) on MAC Osx Due to Psych Yaml Parse Errors
Ruby: How to Load a File into Interactive Ruby Console (Irb)
Measure and Benchmark Time for Ruby Methods
When We Import CSV Data, How Eliminate "Invalid Byte Sequence in Utf-8"
Does Ruby Have a String.Startswith("Abc") Built in Method
What Are the Differences Between Rbenv, Rvm, and Chruby
Why Is Safe Navigation Better Than Using Try in Rails
How to Call a Super Class Method
Detect Number of Cpus Installed
Rails with Paypal Permissions and Paypal Express Checkout
How to Use Ruby Regexp to Substitute String with a "Callback Function"-Like Manipulation
File.Open, Open and Io.Foreach in Ruby, What Is the Difference
Rails 4: How to Reset Test Database
Ruby on Rails App on Google App Engine
What's the Opposite of Chr() in Ruby
Ruby: Module, Require and Include
How to Suppress the Output of Return Value in Irb/Rails Console