0

I tried to install swiftSoup to parse HTML to my xCode project but unfortunately version of swiftSoup installed by command expressed in official site enter image description here

is 1.4 which is unacceptable to work with swift 4.0. I found out that version of swiftSoup compatible with xCode 9 and swift 4.0 is swiftSoup ver.1.5.2 but I does not installs by command i tried from official site( even more i tried to mention version in a pod file and threw me an error. enter image description hereHow can I install the latest version if swiftSoup by cocoapods?

Ninja
  • 309
  • 7
  • 26

3 Answers3

1
platform :ios, ’11.0’

This line indicate that what is your pod deployment target so it will install compatible pod with above platform sometime it's happened that after upgrade your project developer forgot to change this target that why sometime old pod install every time. So always change here if you changed the deployment target of your project.

Chirag Shah
  • 3,034
  • 1
  • 30
  • 61
0

put pod 'SwiftSoup', '~> 1.4' in your pod file and run pod install command and maybe it will help you to get 1.4 version of SwiftSoup

Mahesh Dangar
  • 806
  • 5
  • 11
  • i need 1.5.2 (it installs 1.4 automatically and i dont need it) – Ninja Jul 23 '18 at 08:47
  • @N.Khasanov then you may change pod 'SwiftSoup', '~> 1.5.2' in ur pod file and it will update your pod if there is 1.5.2 is available – Mahesh Dangar Jul 23 '18 at 08:50
  • same error - "[!] CocoaPods could not find compatible versions for pod "SwiftSoup": In Podfile: SwiftSoup (~> 1.5.1) None of your spec sources contain a spec satisfying the dependency: `SwiftSoup (~> 1.5.1)`. " – Ninja Jul 23 '18 at 08:52
  • same ккщк with 1.5 and 1.5.0 and 1.5.2 and 1.5.1 (((( – Ninja Jul 23 '18 at 08:53
0

Finally I succeeded to install swiftSoup ver.1.5.8 after a lot of struggling. In general I needed to install classic ancient version of swiftSoup as described in official site (pod 'SwiftSoup') and with big help of Chirag Shah I got to know that I need to mention my target which is iOS 11 (remove hash sign and does this match with current deployment target) and I need to update my old-world pod by pod update command. Thats it. But there was a problem when I inserted command pod update I got and error:

 Updating spec repo `master`[!]
 Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down

So first I needed to resolve this problem with the big help of this link. I found out that I needed update openssl, then ruby, then cocoapod. Here is copy of steps I took:

1.8.5-p52
1.8.5-p113
1.8.5-p114
1.8.5-p115
1.8.5-p231
1.8.6
:
2.5.0-rc1
2.5.0
2.6.0-dev
:

$ rbenv install 2.5.0

$ rbenv versions
* system (set by /Users/username/.rbenv/version)
2.5.0

$ ruby --version
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

$ rbenv global 2.5.0

$ rbenv versions 
system
* 2.5.0 (set by /Users/username/.rbenv/version)

$ ruby --version
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]

$ gem install cocoapods -n /usr/local/bin

$ which pod
/usr/local/bin/pod

$ pod --version
1.4.0

And then I can return to my project where I uninstalled my old pod and mention target ios 11:

platform :ios, ’11.0’

and eventually insert pod update command then cocopods will update my pod without any error =))

dr_barto
  • 5,723
  • 3
  • 26
  • 47
Ninja
  • 309
  • 7
  • 26