我安装了 rbenv 和 ruby-build,运行了 rbenv install 2.3.0
并且成功了。但是我无法使用任何 Ruby 命令。以下是我收到的各种错误:
user@ubuntu:~$ gem install bundler
rbenv: gem: command not found
The `gem' command exists in these Ruby versions:
2.3.0
user@ubuntu:~$ ruby -v
rbenv: ruby: command not found
The `ruby' command exists in these Ruby versions:
2.3.0
user@ubuntu:~$ rbenv install 2.3.0
rbenv: /home/user/.rbenv/versions/2.3.0 already exists
continue with installation? (y/N)
2.3.0 存在于 ~/.rbenv/versions 中:
user@ubuntu:~$ cd ~/.rbenv
user@ubuntu:~/.rbenv$ ls
bin libexec plugins README.md src versions
completions LICENSE rbenv.d shims test
user@ubuntu:~/.rbenv$ cd versions
user@ubuntu:~/.rbenv/versions$ ls
2.3.0
我重新启动了机器并尝试重新安装,但得到了同样的结果。这台机器上从未安装过 Ruby。
最佳答案
尝试运行rbenv global 2.3.0
。
关于使用 rbenv 成功安装 Ruby,但无法访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34572846/