カテゴリー
SugiBlog Webデザイナー・プログラマーのためのお役立ちTips

VSCode+GitとGitHubを連携させる

VSCodeを使ってローカルリポジトリとGitHubのリモートリポジトリを連携させる方法

まずはGitHubにログインして新しいリポジトリを作成しましょう。
新しいリポジトリを作成したときに表示されるコマンドでの公式のやり方を参考にします。

リポジトリを何の設定もせずに作成したときに以下のような連携方法が表示されます。

…or create a new repository on the command line
echo "# python_practice" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/ユーザー名/リポジトリ名.git
git push -u origin main
…or push an existing repository from the command line
git remote add origin https://github.com/ユーザー名/リポジトリ名.git
git branch -M main
git push -u origin main

前者の方法はローカルリポジトリが未作成の場合の方法です。
今回はローカルリポジトリは作成済のものとして後者の方法で進めていきます。
続きを読む…»

711 views

macOS High SierraでCocoaPodsのpod updateがエラー

macOSがHigh Sierraになり、Xcodeもアップデートされ、
色々と警告が出るようになっていたので、これを解消しようと思ったら
色々つまづいたので書いておきます。

まずはライブラリをアップデートする必要があるようなのでpod updateコマンドを実行。
すると以下のようなエラーが発生。

-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory

どうやらmacOSがHigh Sierraだとエラーが発生する模様です。

Rubyをアップデートするために以下のコマンドを実行。

sudo gem update --system

エラーが発生。

ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/gem

その場合は以下のようなコマンドにするらしいですが、
実行してみると既にインストール済と言われます。

sudo gem update --system -n /usr/local/bin

次にCocoaPodsをアップデート。

sudo gem install cocoapods

これも途中でエラーが発生。

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/bin directory.

コマンドにオプションを付けてやり直し。

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

正常にインストールが完了しました。
続きを読む…»

4,295 views