【问题标题】:Ruby successfully installed with rbenv but is unaccessibleRuby 使用 rbenv 成功安装,但无法访问
【发布时间】:2016-04-06 23:38:42
【问题描述】:

我安装了 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。

【问题讨论】:

    标签: ruby ubuntu rbenv


    【解决方案1】:

    尝试运行rbenv global 2.3.0

    【讨论】:

    • 啊,做到了。第一次使用 rbenv。他们应该把它放在安装指南中!谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-03
    • 2014-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-19
    相关资源
    最近更新 更多