I'm receiving "[!] An internal server error occurred. Please check for any known status issues at https://twitter.com/CocoaPods and try again later." when trying to push a new version of my pod NRSPieChart. I just created this last night and it's the my first time creating my own pod. Everything seemed to have worked on the first submission. Today I updated my version in order to expand my example project and expand my README.md file to provide better Usage instructions. Upon trying to push to Trunk though I get the above error. Since I'm new to this my assumption is I've done something wrong rather than coincidentally there's an error with the spec repo?
I saw one reference to the s.source tag might need a hard code tag string. I tried that but same problem. This is the before (commented line) and after of that attempt:
# s.source = { :git => 'https://github.com/neils4fun/NRSPieChart.git', :tag => s.version.to_s }
s.source = { :git => "https://github.com/neils4fun/NRSPieChart.git", :tag => "0.1.1" }
Update: I tried again "later" as the error message suggested and it's now working. I made no changes to my pod code or pod spec, so chalk this up to something internal on the cocoa pods side of the fence.
Related
I am setting up a private pod that will be used across our team. In my podfile I have something like:
pod 'MySDK', :git => 'https://myusername#bitbucket/...git'
Is there a way to replace myusername with the username that downloaded the current project.
I can get the current username by parsing the url from
git config --get remote.origin.url
Plan B is to make a script that modifies the podfile before running pod install. I am curious if I can make it without this extra step?
This is what I came up, below is part of my podfile
#try to keep the current git user in the pod url
remoteUrl = %x|git config --get remote.origin.url|
username = remoteUrl.scan(/[A-Z0-9._%+-]+#[A-Z0-9.-]+\.[A-Z]{2,4}/i).first
podUrl = "https://#{username}/mycompany/myrepo.git"
puts podUrl
pod 'MySDK', :git => podUrl, :commit => 'commitid'
Works great for me! Respect to all cocopods devs that made it so customizable!
I am trying to figure out why I get two different results after running pod install on what should be identical podspec files. The component is called EarlGreyApp, which had a 2.0.0 release this year. The podspec for the 2.0.0 release is here in the earlgrey2 branch of the EarlGrey repo: https://github.com/google/EarlGrey/blob/earlgrey2/EarlGreyApp.podspec
When I have this defined in the podfile (I am using Demo/EarlGreyExample to reproduce) :
target 'EarlGreyExampleSwift' do
pod 'EarlGreyApp', '2.0.0'
end
It correctly modifies this section of EarlGreyExample.xcodeproj/project.pbxproj to reference EarlGrepApp's AppFramework.framework component:
/* Begin PBXShellScriptBuildPhase section */
4D216774E658C2E4470F936E /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-EarlGreyExampleSwift/Pods-EarlGreyExampleSwift-frameworks.sh",
"${PODS_ROOT}/EarlGreyApp/AppFramework.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AppFramework.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-EarlGreyExampleSwift/Pods-EarlGreyExampleSwift-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
However when I change the podfile to point to the branch:
target 'EarlGreyExampleSwift' do
pod 'EarlGreyApp', :git => 'https://github.com/google/EarlGrey.git', :branch => 'earlgrey2'
end
The above section does not get generated into the project.pbxproj file.
I am at a loss to explain why as the podspec registered for EarlGreyApp should be the same. When I do pod spec cat EarlGreyApp I see the same contents as what is in the earlgrey2 branch.
pod spec cat EarlGreyApp --show-all
Shows me that there are only two Podspecs available, 2.0.0 and 2.0.0-rc
Any ideas on what the difference could be?
The reason for this is because the Podspec is not published through the earlgrey2 branch it is published through the earlgrey2pod branch.
The reason for this is some users want to use EarlGrey without CocoaPods and some want to use it with. The two branches have subtle differences to allow for both use cases (compiling issues).
Additionally there are further intricacies with CocoaPods when you do a manual pod install, as you did when you referenced the github directly. I would recommend not trying that. Since EarlGreyApp is compiled as a Framework you cannot just do that unfortunately (you can with EarlGreyTest which is compiled from source). CocoaPods has poor undefined behavior in this regard.
I am following the Padrino tutorial from here:
https://www.padrinorb.com/guides/blog-tutorial
I am copy and pasting the commands but I quickly ran into an error I don't understand:
$ padrino g controller posts get:index get:show
create app/controllers/posts.rb
create app/views/posts
apply tests/shoulda
/Users/waprin/.rvm/gems/ruby-2.1.0/gems/padrino-gen-0.12.4/lib/padrino-gen/generators/controller.rb:66:in `prepend': can't modify frozen String (RuntimeError)
from /Users/waprin/.rvm/gems/ruby-2.1.0/gems/padrino-gen-0.12.4/lib/padrino-gen/generators/controller.rb:66:in `create_controller'
This might be a bit late, but in case anyone else runs across this error (and because I just worked through the same tutorial) I'll post anyway...
It looks like there's an issue when generating controllers if a test component is specified. In this case you're using shoulda, but the same happens when using rspec and maybe others. It's been reported as a bug: https://github.com/padrino/padrino-framework/issues/1850 and has been fixed, but isn't yet part of a stable release.
One option to fix this would be to change your Gemfile to work with the latest from their github repo. To do this delete your GemFile.lock file, and comment out the line under 'Padrino Stable Gem' in your GemFile:
gem 'padrino', '0.12.4'
then uncomment the line under 'Or Padrino Edge':
gem 'padrino', :github => 'padrino/padrino-framework'
then re-run bundle install.
Of course, you'll no longer be running the stable release, and that may come with other trade-offs.
As a side-note, I believe that the guide on that page is fairly out of date. I also needed to replace:
get :index do
#posts = Post.all(:order => 'created_at desc')
render 'posts/index'
end
with:
get :index, :provides => [:html, :rss, :atom] do
#posts = Post.order('created_at desc')
render 'posts/index'
end
in the Post controller as the active record interface has changed since the time that the guide was written.
I was able to sole this problem by simply going to padrino gem path.
For me it was:
/Users/ahmadhassan/.rvm/gems/ruby-2.2.0/gems/padrino-gen-0.12.4/lib/padrino-gen/generators
open controller.rb and change line number 61:
path = #controller
to
path = #controller.dup
I have been attempting to setup a chef recipe which installs ruby using RVM and then uses the application_ruby cookbook to configure the application, however I keep running into the error
NameError: Cannot find a resource for bundle_options on ubuntu version 12.04
I am using the following code
application "application setup" do
owner "ubuntu"
group "ubuntu"
repository "https://github.com/me/myapplication.git" // Real address removed
path rails_app_path
revision "master"
rails do
bundler true
precompile_assets true
bundler_deployment true
end
end
I noticed that the bundle_options was recently added, https://github.com/opscode-cookbooks/application_ruby/commit/e7719170a661a957796e8e5d58ba8f4ecd937487 however I am unable to track down if this is causing the issue. I have included
depends "application"
depends "application_ruby"
in my metadata.rb and made sure all my dependencies are installed so I am unsure what I am doing wrong at this point.
According to documentation bundle_options is an attribute of the rails resource, not a resource itself.
The only correct way of using it is INSIDE the "rails" block, so you got the message because you either used it as :
an attribute of the application resource (but outside of the "rails" block)
standalone resource (outside of any resource).
Message you mentioned is being displayed when nonexistent resource is being referenced. e.g. if you had tried to execute following code on your system:
nonexistent_resource "failure gonna happen" do
some_attribute "whatever_value"
end
you would've got a message
NameError: Cannot find a resource for nonexistent_resource on Ubuntu version 12.04
I ran into this problem today as well. It appears the problem is that commit e771917 forgot to add the necessary getter for the bundle_option. Someone filed a PR to fix it (https://github.com/poise/application_ruby/pull/44), but it has not yet been merged. I can confirm that when I made that change locally, this error went away. The forked branch in the PR is located at https://github.com/mauriciosilva/application_ruby/tree/bundle_options_fix.
I have some apps that are quite similar. Therefore, I'd like to create a or some private pod(s) containing all common reusable code. My first version contains some networking functionality that uses AFNetworking and also uses KeychainItemWrapper:
Pod::Spec.new do |s|
s.name = 'CommonLib'
s.version = '0.0.1'
s.homepage = '****'
s.summary = 'My Common lib'
s.description = 'Library with common code'
s.author = { "Rens Verhage" => "*****" }
s.platform = :ios, '5.0'
s.source = { :git => "ssh://****/CommonLib.git", :tag => s.version.to_s }
s.source_files = 'CommonLib/*.{h,m}'
s.requires_arc = true
s.dependency 'AFNetworking', '~> 1.3.1'
s.dependency 'KeychainItemWrapper', '~> 1.2'
end
Running pod spec lint CommonLib.podspec gives a couple of WARN and NOTE messages:
-> CommonLib (0.0.1)
- WARN | Missing required attribute `license`.
- WARN | Missing license type.
- NOTE | [xcodebuild] AFNetworking/AFNetworking/AFHTTPClient.h:84:9: warning: SystemConfiguration framework not found in project, or not included in precompiled header. Network reachability functionality will not be available. [-W#pragma-messages]
- NOTE | [xcodebuild] AFNetworking/AFNetworking/AFHTTPClient.h:89:9: warning: MobileCoreServices framework not found in project, or not included in precompiled header. Automatic MIME type detection when uploading files in multipart requests will not be available. [-W#pragma-messages]
- NOTE | [xcodebuild] CommonLib/CommonLib/NSArray+NSArray_PerformSelector.m:19:35: warning: performSelector may cause a leak because its selector is unknown [-Warc-performSelector-leaks]
- NOTE | [xcodebuild] CommonLib/CommonLib/NSArray+NSArray_PerformSelector.m:19:51: note: used here
- WARN | [iOS] Unable to find a license file
Analyzed 1 podspec.
[!] The spec did not pass validation.
Notice there are no ERROR messages, but the spec doesn't pass validation however. I don't really no where to go from here. The message that the SystemConfiguration and MobileCoreServices frameworks are missing looks like an error to me. I tried fixing this warning by adding
s.ios.frameworks = 'MobileCoreServices', 'SystemConfiguration'
to my podspec, but that doesn't work.
So, two questions in one:
What is the error that keeps my podspec from passing validation?
How can I fix the warning about missing frameworks?
Recently I had this problem and adding --allow-warnings fixes the issue.
pod spec lint MyProject.podspec --allow-warnings
Ok. Got my answer from the Cocoapods guys. Podspec validation fails on all errors and warnings. Failing on warnings doesn't mean the project fails as a Pod. Turns out I can simply ignore the warning.
As for AFNetworking, the issue has been resolved with version 2.0.
[Updated]
Follow cocoapods guide to configure you podspec file and resolve the error if you are getting any and while validating it, If you are getting warnings only and if you just want to ignore it then yes you can do it by running following command.
Validating podspec with warnings
Add--allow-warningsat the end it will forcefully validate podspec.👇🏻
pod spec lint your_project_name.podspec --allow-warnings
Push podspec repo with warnings
Make sure that you have added your repo, if not run the following command (ignore it, if you have already added it)
pod repo add your-pods pods_git_url
For Pushing podspec to repo use this 👇🏻
pod repo push your-pods your_project_name.podspec --allow-warnings