小智 43
usingscl enable实际上在当前的 shell 中打开了一个新的 shell,这是非常不干净的,特别是如果从登录脚本完成。
你应该把,而不是,在你的~/.bash_profile:
source /opt/rh/rh-nginx18/enable
Run Code Online (Sandbox Code Playgroud)
或者:
source scl_source enable rh-nginx18
Run Code Online (Sandbox Code Playgroud)
后者更“优雅”,因为它独立于实际安装路径。
这具有在当前shell中加载环境的效果。
ted*_*ted 18
Redhat 建议在 中放置一个文件/etc/profile.d,即对于 python:
$ cat /etc/profile.d/enablepython33.sh
#!/bin/bash
source scl_source enable python33
Run Code Online (Sandbox Code Playgroud)
因为这对我来说适用于 centos 下的 devtools,所以你可以试试这个。