我正在尝试在 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
找不到铁锈。
我该如何解决?
答案1
由于source ~/.profile
引导脚本已经将 rustc 路径附加到我的~/.profile
.
如果路径附加到~/.bashrc
或~/.bash_profile
,source ~/.bashrc
或source ~/.bash_profile
分别应该完成这项工作。
如果脚本未将路径附加到任何文件,您可以自行将路径附加到三个文件中的任何一个(export PATH="$HOME/.cargo/bin:$PATH"
附加在 my 中~/.profile
)并执行source ~/.<respective file>
.
答案2
手动安装 Rust 似乎可以解决这个问题:
curl https://sh.rustup.rs -sSf | sh