LoginSignup
2
0

More than 3 years have passed since last update.

Proxy環境下でのあれこれ

Last updated at Posted at 2020-04-02

Proxy環境下でのあれこれ

環境

  • MacBook Pro(Retina, 15-inch, Mid 2015)
    • macOS Mojave (v 10.14.1)
  • Ruby 2.3.7p456
  • gem 3.0.3
  • Homebrew 2.1.2
  • carthage 0.33.0
  • cocoapods 1.5.3

Proxy書式

http://<serverhost>:<port>
http://<username>:<password>@<serverhost>:<port>

usernameに@が含まれる場合はURLエンコードした%40で置き換える.

gem installができない

$ gem install パッケージ名 -r -p <Proxy>

Proxy環境でgem install - Qiita

環境変数にProxy設定をする

以下のように.bashrcに設定する.
大文字と小文字の両方で設定しないといけないらしい.

~/.bashrc
export HTTP_PROXY=<Proxy>
export HTTPS_PROXY=${HTTP_PROXY}
export http_proxy=<Proxy>
export https_proxy=${http_proxy}

設定後以下のコマンドを実行することで設定が反映される.
.bashrcに他の設定が書かれている場合それらも適用されるので注意すること.)

$ source ~/.bashrc

各環境変数をリセットしたい場合には下記のようにする.

$ unset http_proxy

curlが動かない

.curlrcに設定する.

~/.curlrc
proxy=<Proxy>

curlコマンドにてproxy設定 - Qiita

GitHubに接続ができない

以下のコマンドによってgit configにプロキシ設定をする.

$ git config --global http_proxy <Proxy>
$ git config --global https_proxy <Proxy>

プロキシ経由でcarthage updateができなかった場合の対処法 | DEVRECO

git configの設定値をリセットしたい場合には以下のコマンドを使用する

$ git config --global --unset http_proxy
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0