Skip to content

Commit 613a483

Browse files
FranklinYupostmodern
authored andcommitted
Fix the instruction for macOS about Bash
1 parent b14b94b commit 613a483

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,22 @@ source /usr/local/share/chruby/chruby.sh
217217
source /usr/local/share/chruby/auto.sh
218218
```
219219

220-
*Note:* macOS does not automatically execute `~/.bashrc`, instead try adding to `/etc/bashrc`.
220+
> *Note:* macOS does not automatically source `~/.bashrc`. Bash users should
221+
> create the file `~/.bash_profile` with following content:
222+
>
223+
> ```bash
224+
> if [[ -f ~/.profile ]]; then
225+
> source ~/.profile
226+
> fi
227+
>
228+
> if [[ $- == *i* ]] && [[ -f ~/.bashrc ]]; then
229+
> source ~/.bashrc
230+
> fi
231+
> ```
232+
>
233+
> so that the terminal loads `~/.bashrc` and `~/.profile` (the POSIX one). If
234+
> `~/.bash_profile` exists, Bash users should append the above lines to
235+
> `~/.bash_profile` as needed.
221236
222237
chruby will check the current and parent directories for a [.ruby-version]
223238
file. Other Ruby switchers also understand this file:

0 commit comments

Comments
 (0)