I created a new XCode project and ran pod init at where that project exitsts. I got the following error.
/Users/xxx/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require': incompatible library version - /Users/xxx/.rvm/gems/ruby-2.3.0/gems/json-2.0.2/lib/json/ext/parser.bundle (fatal)
I didn't make any modification to my project. Where is the error coming from? It seems like it's coming from ruby, but it's weird to have a ruby error on a XCode project. Does anyone know how to solve this?
Thanks,
Seems like an issue with your Cocoapods installation, try uninstalling and reinstalling it.
Uninstalling
gem uninstall cocoapods
gem uninstall cocoapods-core
gem uninstall cocoapods-downloader
Reinstalling
gem install cocoapods
Related
I'm using Flutter in my app, when I went to build it showed that. I don't have Cocoapods, when I try to install with SUDO GEM INSTALL COCOAPODS the following message appears (I tried to update the GEM and it also didn't work)
I am trying to install Realm (Objective C) via Cocoapods.
However I keep getting the following error:
Pods/Realm/Realm/module.modulemap:1:18: Redefinition of module 'Realm'
Has anyone faced this problem?
I've tried downloading their CocoapodsExample project but I get the same error.
This is a known issue with CocoaPods 0.38.1, being tracked at https://github.com/CocoaPods/CocoaPods/issues/3886. In the meantime, you can gem install cocoapods -v 0.38.0 and run pod _0.38.0_ install to use CocoaPods 0.38.0, which does not have this issue.
This should now be fixed in CocoaPods 0.38.2.
I found out that the way to resolve an issue, in a library i'm using, is to add use_frameworks! to the podfile. When i run pod install on the terminal, i get the following error:
[!] Invalid Podfile file: undefined method `use_frameworks!' for #.
Updating CocoaPods might fix the issue.
I'm using Cocoapods so i don't understand this issue. This tag is required for projects using swift, i'm using objective-c.
Looks to me like the second part of that error message:
Updating CocoaPods might fix the issue.
Is your issue. use_frameworks! was added in CocoaPods 0.36.0 which was just released recently.
Use pod --version to see what you're currently running. Assuming it's earlier than 0.36.0 you'll need to update it with
[sudo] gem install cocoapods
Which is just the same way you originally installed it.
I had the same issue when trying to run pod install on my mac.
So incase anyone encounters this issue what worked for me was changing the current ruby version with rvm.
On console, Use rvm list to see what versions you have installed:
So the version of ruby that was running on my mac was ruby-2.1.2.
I changed it with:
rvm use ruby-2.2.2
and ran pod install again and it worked.
I recently upgraded to Xcode 6.2 and OSX 10.10 and now adding a pod to my project doesn't work. I get the following error:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- xcodeproj/prebuilt/universal.x86_64-darwin14-2.0.0/xcodeproj_ext (LoadError)
I've tried all the fixes listed in this related question for Ruby 1.8 (Cocoapods No such file to load Error) and I'm still getting the same error.
I've also tried everything from this issue:
https://github.com/CocoaPods/CocoaPods/issues/2219
Things I've tried:
sudo gem uninstall xcodeproj
sudo gem uninstall cocoapods
sudo gem install xcodeproj
sudo gem install cocoapods
If I go to Xcode > Preferences > Locations > Command Line Tools: I only have an option for Xcode 6.2, so some places say to set this to Xcode 6.0, but I don't have this option.
Any help appreciated, thanks!
I had forgotten to add the following to the top of the podfile.
source 'https://github.com/CocoaPods/Specs.git'
In case someone else makes this oversight and comes across this page, hopefully this will be of help.
I am trying to install rails on my mac, but every time I type sudo gem install rails into the command line, I get the following error message. I have been stuck for a while, hope you can help.
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/atomic-1.1.14 for inspection
Results logged to /Library/Ruby/Gems/2.0.0/gems/atomic-1.1.14/ext/gem_make.out
If you are trying to install Rails 4.0, it needs RubyGems 2.0.3, so you have to update your system by using following command
gem update --system 2.0.3
and then continue with your installation.
Hope it helped
I would just use rvm. It should work like a charm. Or you could dig around and see if you can find that ruby.h file its talking about. But I personally think the latter would be a pain in the ass.
Upgrade xcode by typing following command in terminal window-
xcode-select --install
This should solve your isssu.
yea the rvm works like a charm and it will come in handy when you want to switch between different rails versions
I had the same issues. I upgraded my version (using RVM) of Ruby from 2.0.0-p195 to 2.0.0-p353 (make sure you tell RVM to use the new version as the default). After this I did gem install rails again and it worked fine.
Make sure you have installed the right version of DevKit, you can get it from here...
http://rubyinstaller.org/downloads/
and install as it says here:
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit#installation-instructions
if you still have the problem even after Upgrading Xcode.
Its may be because :
The Apple LLVM compiler in Xcode 5.1 treats unrecognized command-line options as errors. This issue has been seen when building both Python native extensions and Ruby Gems, where some invalid compiler options are currently specified.
To workaround this issue, set the ARCHFLAGS environment variable to downgrade the error to a warning.
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install GemName
Personally I have got this problem while installing json gem , I did :
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install json
And the problem was solved.