So I've already built my gem but when I try to push it, it goes directly to Github instead of rubygems.org:
> gem push my-gem.gem
> Pushing gem to https://github.com/User/my-gem...
> Cookies must be enabled to use GitHub.
I've already set up the rubygems link on my gemspec, but nothing chages.
How can I fix that?
Here's my gemspec file:
require_relative 'lib/Mygem/version'
Gem::Specification.new do |spec|
spec.name = "Mygem"
spec.version = Mygem::VERSION
spec.authors = ["Me"]
spec.email = ["email#email.com"]
spec.summary = "Created gem"
spec.description = "Gem utility"
spec.homepage = "https://rubygems.org"
spec.license = "MIT"
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
spec.metadata["allowed_push_host"] = "https://rubygems.org"
spec.metadata["homepage_uri"] = spec.homepage
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.add_development_dependency "bundler", "~> 2.0"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.0"
end
Related
I tried upgrading my Rails app from 5.2.3 to 6.0 without Webpacker first.
Everything works fine locally and Heroku Staging, however, when deploying from Heroku Staging to Heroku Production, SCSS / Bootstrap is not loaded. Also, the rails version loading at production seems to be 4.1 rather than 4.0 as specified in gemfile.
What am I missing?
Gemfile
ruby '~> 2.6.6'
gem 'rails', '~> 6.0'
gem 'pg'
gem 'puma'
gem 'sass-rails'
gem 'sprockets', '~> 4.0'
...
gem 'bootstrap', '~> 4.5.2'
...
gem 'jquery-rails'
gem 'rails_admin', '~> 2.2.0'
Application.js
//= require jquery3
//= require popper
//= require rails-ujs
//= require activestorage
//= require moment
//= require bootstrap-datetimepicker
//= require bootstrap
//= require bootstrap-select
//= require ahoy
//= require cocoon
//= require jstz
//= require_tree .
production.rb
Rails.application.configure do
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
config.assets.js_compressor = Uglifier.new(harmony: true)
config.assets.compile = false
config.active_storage.service = :amazon
config.force_ssl = true
config.log_level = :debug
config.log_tags = [ :request_id ]
config.action_mailer.perform_caching = false
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.action_mailer.smtp_settings = {
address: Rails.application.credentials.dig(:email, :provider_address),
port: 587,
domain: Rails.application.credentials.dig(:domain_name, :production),
authentication: 'plain',
enable_starttls_auto: true,
user_name: Rails.application.credentials.dig(:email, :provider_username),
password: Rails.application.credentials.dig(:email, :provider_password)
}
# ActionMailer Config
config.action_mailer.default_url_options = { host: "www.#{Rails.application.credentials.dig(:domain_name, :production)}" }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
config.log_formatter = ::Logger::Formatter.new
if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end
config.active_record.dump_schema_after_migration = false
end
Rails.application.routes.default_url_options[:host] = Rails.application.credentials.dig(:domain_name, :production)
Rails.application.routes.default_url_options[:protocol] = 'https'
application.html.erb
<%= stylesheet_link_tag 'application', media: 'all' %>
<%= javascript_include_tag 'application', async: true %>
application.scss
#import "bootstrap";
#import "**/*";
#import "1st_load_framework";
#import "fontawesome-all.min";
Here is what I am trying to do:
Installing private pod with vendored_frameworks.
MyFramework.podspec looks like
Pod::Spec.new do |spec|
spec.name = "MyFramework"
spec.summary = "My summary"
spec.version = "1.0.0"
spec.homepage = "https://www.google.com"
spec.authors = { "Me" => "me#gmail.com" }
spec.license = { :type => "MIT", :file => "LICENSE" }
spec.source = { :http => "url to my zip containing the three frameworks" }
spec.platform = :ios, "10.0"
spec.preserve_paths = 'MyFramework1.framework', 'MyFramework2.framework', 'MyFramework3.framework'
spec.ios.vendored_frameworks = 'MyFramework1.framework', 'MyFramework2.framework', 'MyFramework3.framework'
spec.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => "'${PODS_ROOT}/MyFramework1'"}
spec.frameworks = 'MyFramework1', 'MyFramework2', 'MyFramework3'
end
And my Podfile line looks like
pod 'MyFramework1', :git => 'myUrl.git'
The pod spec lint . is working well and also the pod repo push ....
Unfortunately, the three frameworks are not installed when I'm doing pod install.
However, I discovered that if I change my Podfile with
pod 'MyFramework1', :podspec => '/path/to/podspec'
everything is working fine and I got the three frameworks when I'm doing pod install.
Of course, I checked that the podspec is exactly the same as the one on my repo git.
What should I do to get it working with :git => url?
May be you need to do install_framework command
I am trying to find out a way to declare dependency from subspec 'B' to subspec 'A' in the podspec: 'mypodspecfile.podspec' as below:
Pod::Spec.new do |s|
s.name = "MyLib-SDK"
s.version = "1.0"
s.summary = "My Library"
s.homepage = "http://myhomepage.com"
s.ios.deployment_target = "8.0"
s.ios.frameworks = "Foundation", "UIKit", "SystemConfiguration", "Security", "CoreTelephony", "WebKit"
s.source = { :git => "https://github.com/myhome/ios-project.git", :tag => "1.0" }
s.subspec 'MyLibrary-A' do |libOne|
libOne.source_files = "Headers", "Headers/**/*.h"
libOne.exclude_files = "Headers/Exclude"
libOne.resources = "SharedAssets/*"
libOne.libraries = "z","sqlite3" #Zlib for gzip, sqlite3 for event store
libOne.vendored_library = "libMyLibrary_A.a"
end
s.subspec 'MyLibrary-B' do |libTwo|
libTwo.source_files = "Headers", "Headers/**/*.h"
libTwo.exclude_files = "Headers/Exclude"
libTwo.resources = "SharedAssets/*"
libTwo.dependency 'MyLibrary-A' <-- doesn't seem to be working here!!
libTwo.libraries = "sqlite3" # sqlite3 for db
libTwo.vendored_library = "libMyLibrary_B.a"
end
end
When I execute:
$pod spec lint mypodspecfile.podspec --verbose
-ERROR | [iOS] unknown: Encountered an unknown error (Unable to find a specification for MyLibrary-A depended upon by MyLibrary-B
Any help would be greatly appreciated. Thanks you!
You should always write the full path to the pod dependencies. The error states that cocoa pods cannot find the .podspec file for MyLibrary-A in the pod repo(s). To fix the issue, specify full path 'MyLib-SDK/MyLibrary-A'.
So your podspec file should look like this:
Pod::Spec.new do |s|
s.name = "MyLib-SDK"
s.version = "1.0"
s.summary = "My Library"
s.homepage = "http://myhomepage.com"
s.ios.deployment_target = "8.0"
s.ios.frameworks = "Foundation", "UIKit", "SystemConfiguration", "Security", "CoreTelephony", "WebKit"
s.source = { :git => "https://github.com/myhome/ios-project.git", :tag => "#{s.version}" }
s.subspec 'MyLibrary-A' do |libOne|
libOne.source_files = "Headers", "Headers/**/*.h"
libOne.exclude_files = "Headers/Exclude"
libOne.resources = "SharedAssets/*"
libOne.libraries = "z","sqlite3" #Zlib for gzip, sqlite3 for event store
libOne.vendored_library = "libMyLibrary_A.a"
end
s.subspec 'MyLibrary-B' do |libTwo|
libTwo.source_files = "Headers", "Headers/**/*.h"
libTwo.exclude_files = "Headers/Exclude"
libTwo.resources = "SharedAssets/*"
libTwo.dependency 'MyLib-SDK/MyLibrary-A' # here is the change
libTwo.libraries = "sqlite3" # sqlite3 for db
libTwo.vendored_library = "libMyLibrary_B.a"
end
end
I want use version '1.1.0' of Alamofire-SwiftyJSON
My Podfile is:
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :tag => '1.2.3'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git', :tag => '2.2.0'
pod 'Alamofire-SwiftyJSON', :git => "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON.git", :tag => '1.1.0'
and I got follow error:
Analyzing dependencies
Pre-downloading: `Alamofire` from `https://github.com/Alamofire/Alamofire.git`, tag `1.2.3`
Pre-downloading: `Alamofire-SwiftyJSON` from `https://github.com/SwiftyJSON/Alamofire-SwiftyJSON.git`, tag `1.1.0`
[!] Unable to find a specification for 'Alamofire-SwiftyJSON'.
This is a normal situation. The Alamofire-SwiftyJSON repository does not have a podspec into its repo at the tag 1.1.0 and no pod has been push to the cocoapod trunk.
You will have to fork the project, and add the Alamofire-SwiftyJSON.podspec to the root by yourself. An example of what it should look like:
Pod::Spec.new do |s|
s.name = "Alamofire-SwiftyJSON"
s.version = "1.1.0"
s.summary = "Alamofire extension for serialize NSData to SwiftyJSON "
s.homepage = "https://github.com/[your github name]/Alamofire-SwiftyJSON"
s.license = { :type => "MIT" }
s.requires_arc = true
s.osx.deployment_target = "10.9"
s.ios.deployment_target = "8.0"
s.source = { :git => "https://github.com/[your github name]/Alamofire-SwiftyJSON.git", :tag => s.version }
s.source_files = "Source/*.swift"
s.dependency 'Alamofire', '1.3'
s.dependency 'SwiftyJSON', '2.2.0'
end
Here is my podspec:
Pod::Spec.new do |s|
s.name = "MXMarkdownKeyboard"
s.version = "0.0.3"
s.summary = "MarkdwonKeyboard for iOS"
s.homepage = "https://github.com/mexiQQ/MXMarkdownKeyboard"
s.license = { :type => "MIT", :file => "LICENSE.md" }
s.author = { "mexiqq" => "ljw040426#gmail.com" }
s.platform = :ios
s.source = { :git => "https://github.com/mexiQQ/MXMarkdownKeyboard.git",:tag => '0.0.3'}
s.source_files = "MXMarkdownKeyboard", "MXMarkdownKeyboard/*.{h,m}"
end
The repo is here: https://github.com/mexiQQ/MXMarkdownKeyboard
When I execute pod spec lint it returns:
MXMarkdownKeyboard.podspec passed validation.
But, when I execute pod trunk push I get this error:
[!] The Pod Specification did not pass validation.
How can I fix this and push my spec to trunk?
It's expecting a file called LICENSE in the root of your repo, but it can't find one.