-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Current CocoaPods should be installable on Mojave without dependency upgrades #9641
Comments
Hey there and thanks for the issue. I apologize if any of the other issues have come off "brush-offy" (is that even a word?). Anyway, intention is not to ignore people or their efforts but overall CocoaPods gets a ton of issues around environment setup or more or less "irrelevant" to CocoaPods issues. Having said that, if someone is installing CocoaPods and its failing to do so I can see a reason to file an issue here... Back to this issue. I have Mojave 10.14.6 and I install CocoaPods and different versions of Ruby almost daily. I do not hit this issue so I kindly ask you if possible to provide steps to reproduce. |
@dnkoutso Thank you for the thoughtful response! I was really hoping for, if not a fix, at least a clearer understanding of why it wasn't being addressed. "Can't reproduce" is a far more interesting angle. It's not completely impossible that something I did to my environment in the distant past triggered this behavior, but I've installed and upgraded CocoaPods a number of times over the years and never had trouble before. I think the best way for me to provide steps is to uninstall rvm and the Ruby version, see if I reproduce the problem, and provide a console log if so. I'll post that shortly if I'm successful. |
Thanks again! You are very right, somewhere along all the similar issues filed I may have asked for steps before and maybe a prior issue was closed due to being unable to reproduce. I will keep this open of course and hopefully we will get to the bottom of this. |
Keep in mind we automatically close issues via a bot if it becomes inactive. |
Here's an annotated transcript of my console session reproducing the problem. I've also discovered that even though I've now built CocoaPods correctly, I can't run it. I've just begun to look at that, but it looks like it's still using a search path that includes the system Ruby. That's at the end of this transcript. Initial environment — note using system Ruby, v2.3.7:
For good measure, although I don't think this is important:
Initial attempt to install Cocoapods fails due to missing header files:
Install rvm and use it to install Ruby 2.6.x (as suggested on StackOverflow):
Confirm using Ruby 2.6.5:
CocoaPods installation is now successful:
Running
|
From the last part it seems it went through:
which was your system ruby not 2.6.5 even though the stacktrace includes traces of Ruby 2.6.5... |
Right, that's what I said at the beginning of my note. :-) I may be close to a fix for that piece — best ignore that part for now. (UPDATE: not sure exactly what I did right but it's running now.) |
nice |
@dnkoutso Let me know if that transcript provides enough in the way of repro instructions. I'm not sure what I can add to it, so I hope so! |
Same issue with exactly the same env. |
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
|
Its certainly more info than other reports. Unfortunately I cant tell again what is wrong with CocoaPods per se except that a downstream dependency somehow does not install on Ruby 2.3.x. I'd appreciate anyone who can help here. |
It looks like |
In ffi/ffi#706 they recommend using ffi 1.9.17 as a workaround, I don't know the dependency tree but perhaps that version can be locked in |
@orta It's possible there's a config issue on my end, but I get basically the same error with 1.9.17:
|
CocoaPods/Core#580 is the PR that added this dependency, it is possible to undo this but would take some work and also undo a lot of improvements that were made |
Is there a recommended workaround for this issue? I don't have much experience with ruby, so I don't know what the best way to upgrade ruby without breaking things would be. I'd really appreciate a clear set of commands I could execute. I'd tried using rvm a few weeks back, but whatever I'd done didn't work. I'm on macOS Catalina and |
what @mferber suggested works fine, cheers. |
@TylerADavis If you haven't already found it, I documented a transcript upthread of what did and didn't work for me, which ought to serve as a guide to the workaround. See specifically the part beginning "Install rvm." #9641 (comment) |
(Unfortunately, you'll see that after I'd successfully installed CocoaPods, running it failed at first due to a bad ruby module search path, and I got it working without identifying exactly what had fixed the problem. If that happens to you, I'd recommend restarting the terminal and maybe even rebooting your computer, then running the "rvm use" command again, to make sure the paths are all fully reinitialized, but I can't promise that will work. Hope this is of some help!) |
Thanks @mferber , I'd missed that originally. I followed the steps you took, but I'm still unable to build cocoapods. It looks like I'm using the same version of ruby (2.6.5, though I also tried 2.6.6) and lib ffi (1.12.2) as you, so I'm not sure where the issue is coming from. In the error messages it looks like the paths are messed up as it's still mentioning 2.6.0? This is despite restarting both the terminal and rebooting my computer. Is there some step I'm missing to make the install actually use the version of ruby from RVM? tyler@s ~ % rvm use ruby-2.6.5
Using /Users/tyler/.rvm/gems/ruby-2.6.5
tyler@s- ~ % which ruby
/Users/tyler/.rvm/rubies/ruby-2.6.5/bin/ruby
tyler@s ~ % ruby --version
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
tyler@s ~ % sudo gem install cocoapods
Password:
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Users/tyler/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/ffi-1.12.2/ext/ffi_c
/Users/tyler/.rvm/rubies/ruby-2.6.5/bin/ruby -I /Users/tyler/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0 -r ./siteconf20200426-1485-18l80cq.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for shlwapi.h... no
checking for rb_thread_call_without_gvl()... yes
checking for ruby_native_thread_p()... yes
checking for ruby_thread_has_gvl_p()... yes
creating extconf.h
creating Makefile
current directory: /Users/tyler/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/ffi-1.12.2/ext/ffi_c
make "DESTDIR=" clean
current directory: /Users/tyler/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/ffi-1.12.2/ext/ffi_c
make "DESTDIR="
Configuring libffi
configure: error: in `/Users/tyler/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi-x86_64-darwin19':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
make: *** ["/Users/tyler/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi-x86_64-darwin19"/.libs/libffi_convenience.a] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/tyler/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/ffi-1.12.2 for inspection.
Results logged to /Users/tyler/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-19/2.6.0/ffi-1.12.2/gem_make.out |
@TylerADavis It's trying and failing to build the Mac-native part of the gem that Cocoapods is depending on. We're getting slightly outside of my area of confidence, but based on some quick googling, it sounds like the first thing to check is that your Xcode is fully up to date, and if that doesn't work, then you might need to (re)install the developer command line tools ( If those don't work, which sounds like a real possibility, I'm probably not going to be able to help much without doing some real research. Maybe someone from the dev team will be able to chime in with something more solid, I hope. Good luck!! |
I was able to work around this by installing the cocoapods desktop app: |
That's fantastic, I had no idea that existed! |
It turns out the app is actually pretty out of date, so I did the following to get cocoa pods to work
|
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍 |
@mferber 's step by step guide helped me out to install cocoapods (I needed it for my Unity project). To not make this just a thank you reply, I will contribute by adding that you can do the same procedure by using Homebrew as well (for the step of installing ruby). This stackoverflow answer is quite useful for that purpose: |
Several tickets related to this problem have been closed as having to do with the user's build environment rather than the CocoaPods install itself (here's one closed yesterday). That would be reasonable if this was an extremely old OS or the user had messed it up, but we're talking about a perfectly normal Mojave install. Mojave is only one major version behind.
CocoaPods installation should not fail on an unmodified Mojave installation. Please reconsider the "not our problem" attitude. CocoaPods should be usable without difficulty on all macOS platforms that are in wide usage. Leaving high barriers for users unaddressed is bad for CocoaPods. I beg you to consider at least one of the following options:
gem install
can be controlled).From the perspective I'm coming from, the current approach appears as a rather shocking disregard for CocoaPods's usability. I really beg you to think again about addressing this problem. It's clearly common, and it will only be to CocoaPods's benefit to give users an assist here.
Report
What did you do?
sudo gem install cocoapods
on macOS Mojave 10.14.6What did you expect to happen?
Expected CocoaPods to install cleanly.
What happened instead?
Ruby errors: "Failed to build gem native extension." To resolve the problem I had to search through CocoaPods issues and StackOverflow and try to evaluate a number of different suggestions for solving the problem, most of which were not solidly within my current expertise (I haven't worked in Ruby for several years). Ultimately I installed rvm and Ruby 2.6.3, and that worked, but from the available sources, I didn't have great confidence that it was the best solution.
CocoaPods Environment
n/a
The text was updated successfully, but these errors were encountered: