Linux-Mint
Firefox 建構“你的路徑中必須有 ‘rustc’”?
我正在嘗試從 Mint 17 上的原始碼建構 Firefox 51。
我已經執行了 boostrap 腳本並安裝了 rust,但
./mach build
顯然找不到它?錯誤是:
0:03.58 checking for rustc... not found 0:03.58 checking for cargo... not found 0:03.58 ERROR: Rust compiler not found. 0:03.58 To compile rust language sources, you must have 'rustc' in your path. 0:03.58 See https//www.rust-lang.org/ for more information. 0:03.58 0:03.58 You can install rust by running './mach bootstrap' 0:03.58 or by directly running the installer from https://rustup.rs/ 0:03.58
但我已經跑了
./mach bootstrap
,它安裝了 rust!現在當我
./mach bootstrap
再次執行時,它說:Could not find a Rust compiler. You have some rust files in /home/user/.cargo/bin but they're not part of this shell's PATH. To add these to the PATH, edit your shell initialization script, which may be called ~/.bashrc or ~/.bash_profile or ~/.profile, and add the following line: source /home/user/.cargo/env Then restart your shell and run the bootstrap script again.
所以我就這麼做了。
~/.profile
現在已經source /home/user/.cargo/env
在底部了。我重新啟動了終端。而且./mach bootstrap
仍然./mach build
找不到生鏽。我該如何解決?
手動安裝 Rust 似乎解決了這個問題:
curl https://sh.rustup.rs -sSf | sh
因為引導
source ~/.profile
腳本已經在我的~/.profile
.如果路徑附加到
~/.bashrc
or~/.bash_profile
,source ~/.bashrc
orsource ~/.bash_profile
應該分別完成這項工作。如果腳本未將路徑附加到任何文件,您可以自行將路徑附加到三個文件中的任何一個(
export PATH="$HOME/.cargo/bin:$PATH"
附加在 my 中~/.profile
)並執行source ~/.<respective file>
.