시스템이 설치된 루비 구성 요소를 찾는 데 필요한 환경 인 것 같습니다. 로그인 쉘에 대해서만 읽을 수있는 파일에 지정되어 있습니다. bash 매뉴얼 페이지에는 로그인 쉘과 비 로그인 쉘의 차이점에 대해 설명합니다.
INVOCATION
A login shell is one whose first character of argument zero is a -, or
one started with the --login option.
과
When bash is invoked as an interactive login shell, or as a non-inter‐
active shell with the --login option, it first reads and executes com‐
mands from the file /etc/profile, if that file exists. After reading
that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
in that order, and reads and executes commands from the first one that
exists and is readable.
이므로
When an interactive shell that is not a login shell is started, bash
reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if
these files exist.
따라서 루비 환경 변수가 /home/rails/.profile있거나 /etc/profile예를 들어 셸 환경에 추가되면
- 명시 적으로 사용하여 로그인 쉘 호출하여
su -l rails또는 su --login rails또는 속기su - rails
- 사용자가
railsSSH를 통해 로그인 할 때
bash --login로그인 후 와 같이 서브 쉘을 시작함으로써
user로 전환하는 방법에 관계없이 루비 환경을 설정 rails하려면 관련 변수 정의를 사용자 ~/.bashrc대신 이동할 수 있습니다.
su? 또는 비슷한su -l또는su --?)로 어떻게 전환하고 있습니까? 사용자 "레일"의 로그인 쉘은 무엇입니까? (당신은 사용자의 PATH 변수를 수정하고 만약 그렇다면 어떤 파일에서 한~/.profile또는~/.bashrc나~/.bash_profile? 나 ...)