LoginSignup
0
2

More than 5 years have passed since last update.

Proxy内でrustをインストールしようとしたらハマった

Posted at

環境

  • Ubuntu 16.04

Proxyを利用しているで$HOME/.bashrcには次のような設定がしてある.

HOST="proxy.example.com"
PORT="8080"
PROXY="$HOST:$PORT"
export http_proxy="http://$PROXY"
export https_proxy="https://$PROXY"

インストールの流れ

Rustのサイトにしたがって以下を実行した.

$ curl https://sh.rustup.rs -sSf | sh

インストールが成功したか確認したいので以下の簡単なプログラムを実行してみる.

main.rs
fn main(){
    println!("Hello, world!");
}

インストールがうまくいったと思いきやrustc main.rsでエラーが出たのでインストールをやり直す.

$ sudo /usr/local/lib/rustlib/uninstall.sh 

こちらのサイト(リンク)によるとcurlなどの実行に際してはhttp://やhttps://などが余計らしいので以下の操作を行う.

$ export http_proxy=proxy.example.com:8080
$ export https_proxy=proxy.example.com:8080

もう一度インストールしてみる.

$ curl https://sh.rustup.rs -sSf | sh
$ rustc main.rs
$ ./main

Hello, World!が表示されました.いえーい

参考URL

0
2
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
0
2