From a1fb5b1153368e3cd4d47d50965b301f81ca3ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 3 Oct 2013 20:07:22 +0200 Subject: [PATCH] better Ubuntu Desktop installation instructions Don't suggest that they add to their `.profile` anymore because: 1. They would have to restart the desktop session for their change to be reflected, or source the file manually; 2. An error in `.profile` may prevent logging in; 3. The `rbenv()` shell function and shell completions won't be available in Terminal since it doesn't start bash in login mode by default. Therefore, suggest that they use `.bashrc` instead. This will be immediately reflected in a new Terminal tab. If bash is started in login mode somehow, the default `.profile` is set up to source `.bashrc` anyway. Also, don't suggest restarting the shell environment with `exec $SHELL -l`, since we don't know what was the original mode that their shell was started in. (OS X Terminal.app will be login mode, Ubuntu Terminal has non-login mode by default.) Mode can be checked with: * bash: `shopt -q login_shell` * zsh: `[[ $options[login] = "on" ]]` But since this is gnarly, let's just avoid it altogether and go the easy route. Closes #305, fixes #373, reverts #286 --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 39267560..656cf49b 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ easy to fork and contribute any changes back upstream. $ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile ~~~ - **Ubuntu note**: Modify your `~/.profile` instead of `~/.bash_profile`. + **Ubuntu Desktop note**: Modify your `~/.bashrc` instead of `~/.bash_profile`. **Zsh note**: Modify your `~/.zshrc` file instead of `~/.bash_profile`. @@ -177,13 +177,14 @@ easy to fork and contribute any changes back upstream. $ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile ~~~ - _Same as in previous step, use `~/.profile` on Ubuntu, `~/.zshrc` for Zsh._ + _Same as in previous step, use `~/.bashrc` on Ubuntu, or `~/.zshrc` for Zsh._ -4. Restart your shell as a login shell so the path changes take effect. - You can now begin using rbenv. +4. Restart your shell so that PATH changes take effect. (Opening a new + terminal tab will usually do it.) Now check if rbenv was set up: ~~~ sh - $ exec $SHELL -l + $ type rbenv + #=> "rbenv is a function" ~~~ 5. Install [ruby-build](https://github.com/sstephenson/ruby-build),