I am using the ank solution from this SO question: Cocoapods: disabling MagicalRecord , which used to work well before I upgraded CocoaPods to the latest version (0.38. 2). Now when I run the command pod install, it returns a few errors.
For reference, here is the original Podfile snippet shared by ank ( link ):
post_install do |installer|
target = installer.project.targets.find{|t| t.to_s == "Pods-MagicalRecord"}
target.build_configurations.each do |config|
s = config.build_settings['GCC_PREPROCESSOR_DEFINITIONS']
s = [ '$(inherited)' ] if s == nil;
s.push('MR_ENABLE_ACTIVE_RECORD_LOGGING=0') if config.to_s == "Debug";
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = s
end
end
The first problem I encountered was that I projecthad to replace it with pods_projecta subfile, which is why I did it.
But the one that made me stuck in the fact that it does not recognize the operator build_configurations, as you can see on the console error below:
...
Generating Pods project
[!] An error occurred while processing the post-install hook of the Podfile.
undefined method `build_configurations' for nil:NilClass
...
, SO, gitHub, . , , , CocoaPods, , - loggin MagicalRecord (BTW 2.2).
:
post_install do |installer|
target = installer.pods_project.targets.find{|t| t.to_s == "Pods-MagicalRecord"}
target.build_configurations.each do |config|
s = config.build_settings['GCC_PREPROCESSOR_DEFINITIONS']
s = [ '$(inherited)' ] if s == nil;
s.push('MR_ENABLE_ACTIVE_RECORD_LOGGING=0') if config.to_s == "Debug";
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = s
end
end
:)