瀏覽代碼

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
pull/360/head^2
Mislav Marohnić 11 年之前
父節點
當前提交
a1fb5b1153
共有 1 個文件被更改,包括 6 次插入5 次删除
  1. +6
    -5
      README.md

+ 6
- 5
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),

Loading…
取消
儲存