Amazon Lightsail を払い出したときには、Timezone が UTC になっていますので、日本時間に変更する必要があります。
OSの設定と、PHPの設定の変更を行います。
OSの設定変更
日本時間に変更
$ sudo timedatectl set-timezone Asia/Tokyo
設定の確認
$ timedatectl status Local time: Mon 2021-03-08 19:03:46 JST Universal time: Mon 2021-03-08 10:03:46 UTC RTC time: Mon 2021-03-08 10:03:47 Time zone: Asia/Tokyo (JST, +0900) System clock synchronized: yes NTP service: inactive RTC in local TZ: no
$ sudo gem install cocoapods Fetching ffi-1.14.2.gem Fetching cocoapods-1.10.1.gem Fetching cocoapods-core-1.10.1.gem Building native extensions. This could take a while… Successfully installed ffi-1.14.2 Successfully installed ethon-0.12.0 Successfully installed typhoeus-1.4.0 Successfully installed public_suffix-4.0.6 Successfully installed addressable-2.7.0 Successfully installed cocoapods-core-1.10.1 ERROR: While executing gem … (Gem::FilePermissionError) You don’t have write permissions for the /usr/bin directory.
Xcode でプロジェクト作成
Xcode で、SwiftSoap を利用するプロジェクトを作成します。
$ pwd /Users/ … /SampleProject
$ ls Build/ SampleProject/ SampleProject.xcodeproj/ SampleProjectTests/ SampleProjectUITests/
Pod の初期設定(SwiftSoup 初期設定)
pod init で初期化を実施します。
$ pod init $ ls -F Build/ Podfile SampleProject/ SampleProject.xcodeproj/ SampleProjectTests/ SampleProjectUITests/ $ vi Podfile
できあがった Podfile を viコマンドで編集し、pod SwiftSoup を追加します。
# Uncomment the next line to define a global platform for your project # platform :ios, ‘9.0’
target ‘SampleProject’ do # Comment the next line if you don’t want to use dynamic frameworks use_frameworks!
# Pods for SampleProject pod ‘SwiftSoup’
target ‘SampleProjectTests’ do inherit! :search_paths # Pods for testing end
target ‘SampleProjectUITests’ do # Pods for testing end
end
Pod で SwiftSoup のインストールを実施します。この時、Xcode は完全に終了させておいてください。(2回目以降は pod update を実行します。)
$ pod install
いくつかの Warning がでますが、無視して構いません。
$ pod install Analyzing dependencies Downloading dependencies Generating Pods project Integrating client project Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
[!] Automatically assigning platform `iOS` with version `14.0` on target `SampleProject` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
[!] The `SampleProjectUITests [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-SampleProject-SampleProjectUITests/Pods-SampleProject-SampleProjectUITests.debug.xcconfig’. This can lead to problems with the CocoaPods installation – Use the `$(inherited)` flag, or – Remove the build settings from the target.
[!] The `SampleProjectUITests [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-SampleProject-SampleProjectUITests/Pods-SampleProject-SampleProjectUITests.release.xcconfig’. This can lead to problems with the CocoaPods installation – Use the `$(inherited)` flag, or – Remove the build settings from the target.