- Trouble with installing cocoapods
- Accepted Answer
- Answers
- Gem install ffi mac os
- Can’t Install ffi -v ‘1.9.18’ on macos Catalina
- 5 Answers 5
- Other background:
- CocoaPods on M1 (Apple Silicon) fails with ffi wrong architecture
- 2 Answers 2
- Install Ruby development tools for gem installation on OSX Catalina
- 2 Answers 2
- Scripting Language Runtimes
- Deprecations
Trouble with installing cocoapods
I am getting the same error over and over again and I do not know why. I tried several ways to fix it, but nothing works.
Something might be wrong with Ruby, but I could not figure out what I should do to fix it.
Accepted Answer
Depending on some aspects this might work for you, if you don’t mind using the «SUDO» command:
sudo gem install -n /usr/local/bin cocoapods -v 1.8.4
Latest CocoaPods 1.10.0 won’t work.
Having same issue with my mac, anyone please help.
I really don’t know how to thank you I spent 4 hours trying to solve this problem Thank you with all my heart
Answers
1) Install homebrew via terminal.
2) After homebrew is successfully installed, type in the terminal ‘$ brew install cocoapods’
this works for me.
sudo xcode-select —switch /Applications/Xcode-beta.app/Contents/Developer
explain solution
sudo xcode-select —switch
Depending on some aspects this might work for you, if you don’t mind using the «SUDO» command:
sudo gem install -n /usr/local/bin cocoapods -v 1.8.4
Latest CocoaPods 1.10.0 won’t work.
Having same issue with my mac, anyone please help.
I really don’t know how to thank you I spent 4 hours trying to solve this problem Thank you with all my heart
Thank you all ! With sudo gem install cocoapods it worked!
Same problem — XCode 12.3 on Mac OS 10.15.6.
Tried the CocoaPod mac app from the CocoaPods about page, which did have an option to install the command line tool, but it was version 1.1.x for some reason.
Brew install did the trick, and installed 1.10.0.
hai @ Me -Human has your problem been solved?
am having the same problem , using: brew install cocoapod , would install version 1.5 and I need version 1.10 even when I tried brew it installed version 1.5. every time I upgrade , it gives me same error msg:
Источник
Gem install ffi mac os
Ruby-FFI is a gem for programmatically loading dynamically-linked native libraries, binding functions within them, and calling those functions from Ruby code. Moreover, a Ruby-FFI extension works without changes on CRuby (MRI), JRuby, Rubinius and TruffleRuby. Discover why you should write your next extension using Ruby-FFI.
- Intuitive DSL
- Supports all C native types
- C structs (also nested), enums and global variables
- Callbacks from C to Ruby
- Automatic garbage collection of native memory
For less minimalistic and more examples you may look at:
- the samples/ folder
- the examples on the wiki
- the projects using FFI listed on the wiki: https://github.com/ffi/ffi/wiki/projects-using-ffi
When installing the gem on CRuby (MRI), you will need:
- A C compiler (e.g., Xcode on macOS, gcc or clang on everything else) Optionally (speeds up installation):
- The libffi library and development headers — this is commonly in the libffi-dev or libffi-devel packages
The ffi gem comes with a builtin libffi version, which is used, when the system libffi library is not available or too old. Use of the system libffi can be enforced by:
or prevented by —disable-system-libffi .
On Linux systems running with PaX (Gentoo, Alpine, etc.), FFI may trigger mprotect errors. You may need to disable mprotect for ruby ( paxctl -m [/path/to/ruby] ) for the time being until a solution is found.
On FreeBSD systems pkgconf must be installed for the gem to be able to compile using clang. Install either via packages pkg install pkgconf or from ports via devel/pkgconf .
Источник
Can’t Install ffi -v ‘1.9.18’ on macos Catalina
Can’t install specific ffi version. If I run gem install ffi, everything works just fine but I need specific version 1.9.18 and it doesn’t work.
/Users/chille/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ffi-1.9.18 for inspection. Results logged to /Users/chille/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/extensions/x86_64- darwin-19/2.6.0/ffi-1.9.18/gem_make.out
An error occurred while installing ffi (1.9.18), and Bundler cannot continue. Make sure that gem install ffi -v ‘1.9.18’ succeeds before bundling.
In Gemfile: bootstrap-sass was resolved to 3.3.7, which depends on sass was resolved to 3.5.5, which depends on sass-listen was resolved to 4.0.0, which depends on rb-inotify was resolved to 0.9.10, which depends on ffi
5 Answers 5
To get past that error, install ffi using:
gem install ffi -v ‘1.9.18’ — —with-cflags=»-Wno-error=implicit-function-declaration»
For those who can, I think bumping ffi version should be preferred here. bundle update ffi took me from from 1.9.18 to 1.13.1 and built successfully for me.
@denis-osmerovic, unless you have another dependency holding ffi back, you should also be able to bump ffi. Checking my dependency chain, my ffi dependency is also coming from rb-inotify 0.9.10 , same as yours. The listed requirement is for ffi (>= 0.5.0, , so 1.13.1 should be acceptable.
Other background:
I previously had a working copy of ffi 1.19.18 , and I don’t remember needing to pass any special build flags. In order to reproduce this I uninstalled and tried to reinstall that version. I’m guessing other library or toolchain updates in the meantime broke this.
I am running ruby 2.6.3 on OS X 10.15.7 alongside Xcode 12.0.1
Источник
CocoaPods on M1 (Apple Silicon) fails with ffi wrong architecture
Running ‘pod install’ on a M1 MacBook failed for me due to an ffi issue, as described here.
I followed some of the workarounds (I guess I tried all of them in various order), but now I get a slightly different error:
So, it seems I now have ffi, but with a wrong architecture? How can I fix this? This happens with/without running the terminal in Rosetta mode.
One of the proposed workarounds did not succeed for me, by the way. When I try:
Not sure if this is related.
2 Answers 2
Answering my own question. I fixed the ffi issue by uninstalling my faulty Ruby version and CocoaPods, then I used the -x86_64 arch to reinstall ffi and CocoaPods.
These are the steps I did to get back to a working state (and to apply the M1 workarounds for ffi):
Uninstall Ruby with: brew uninstall ruby —force
Uninstall CocoaPods. At first, try to list all CocoaPods versions / components with gem list —local | grep cocoapods . Then uninstall them one by one, in my case:
sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-downloader
- As a next step I was able to reinstall ffi and then CocoaPods with:
sudo arch -x86_64 gem install ffi
sudo arch -x86_64 gem install cocoapods
Once done, I could run pod install as expected. Note that I had the Terminal open all the time in standard mode — no Rosetta required.
Источник
Install Ruby development tools for gem installation on OSX Catalina
I know there are many instances of this question. I’ve done everything in those answers and have gotten nowhere after 4 hours.
I am trying to install a gem on Catalina 10.15.7 and getting the ever-popular
with this additional context
when invoking the installation via
to get around Catalina’s draconian permissions rules.
I’ve freshly downloaded XCode and the command line tools:
I’ve accepted the license at least four times via
as Gem installation error: You have to install development tools first suggests. I am not on Windows so the rubyinstaller link does not help me.
Can’t Find ffi.h When Installing ffi ruby gem references the exact gem I am trying to install, but as indicated xcode-select —install is not the answer.
None of the answers in Developer tools issues when installing Ruby gems are helpful either; I have already brew install openssl and brew install libffi and have exported the variables it told me to:
I’ve also tried the suggestions in How to update Xcode from command line — xcode-select -r does nothing, xcode-select -s /Library/Developer/CommandLineTools does nothing, and $ sudo rm -rf /Library/Developer/CommandLineTools prevents xcode-select —install from working, and additionally I moved it anyway and redownloaded the command line dmg package from Apple’s developer site. Still same problem.
What do I try next to get this gem to install?
2 Answers 2
Finally got it after hours. I followed this instruction, changed it a bit
Make sure brew is installed. If not /bin/bash -c «$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)»
Set shell to zsh curl -L http://install.ohmyz.sh | sh
eval «$(rbenv init -)»
Install Ruby Version Manager brew update brew install rbenv ruby-build
Install Ruby rbenv install 2.6 # I used my systems default version number because I was not sure if it messes with my OS X system version. rbenv global 2.6 rbenv rehash
Add it to your zsh echo ‘eval «$(rbenv init -)»‘ >>
That did it for me. All the other stuff like installing Xcode, accept the Xcode License, Xcode command line tools did not do it.
Judging by the path names in your error message, you are trying to modify Apple’s System Ruby. This is not allowed.
Apple’s System Ruby is exclusively for internal use by macOS and/or support for legacy applications. You must not use it, and you most certainly must not modify it. Modifying it would negate the whole «support for legacy applications» thing.
Apple itself has the following to say in the release notes for macOS 10.15 Catalina:
Scripting Language Runtimes
Deprecations
- Scripting language runtimes such as Python, Ruby, and Perl are included in macOS for compatibility with legacy software. Future versions of macOS won’t include scripting language runtimes by default, and might require you to install additional packages. If your software depends on scripting languages, it’s recommended that you bundle the runtime within the app. (49764202)
There are many, many options for installing Ruby on macOS, including but not limited to compiling it yourself, downloading pre-compiled binaries, Homebrew, ruby-install, ruby-build, RVM. There are many options for managing Ruby installations on macOS, including but not limited to chruby, asdf, rbenv, and RVM.
Most of these have the added advantage that they support newer versions than the one Apple ships, and even more interesting, they support different implementations than just YARV. My personal favorite is TruffleRuby, which, when run on the GraalVM, was up to 1000 times faster for me, depending on the benchmark.
Источник