【问题标题】:Trying to install ruby 1.9.3 with rbenv but keep getting ruby 1.8尝试使用 rbenv 安装 ruby​​ 1.9.3 但不断获得 ruby​​ 1.8
【发布时间】:2013-02-05 23:45:00
【问题描述】:

这是我运行的命令列表,尝试使用 rbenv 安装 ruby​​ 1.9.3-p0,但每次运行 ruby --version 时都会得到 1.8.23。我不知道这是为什么?

Anderss-MacBook-Pro:anchor anderskitson$ ruby --version
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
Anderss-MacBook-Pro:anchor anderskitson$ rbenv install 1.9.3-p0
Downloading yaml-0.1.4.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/36c852831d02cf90508c29852361d01b
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/anderskitson/.rbenv/versions/1.9.3-p0

Downloading ruby-1.9.3-p0.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/8e2fef56185cfbaf29d0c8329fc77c05
Installing ruby-1.9.3-p0...
Installed ruby-1.9.3-p0 to /Users/anderskitson/.rbenv/versions/1.9.3-p0

Downloading rubygems-1.8.23.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/178b0ebae78dbb46963c51ad29bb6bd9
Installing rubygems-1.8.23...
Installed rubygems-1.8.23 to /Users/anderskitson/.rbenv/versions/1.9.3-p0

Anderss-MacBook-Pro:anchor anderskitson$ ruby --version
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
Anderss-MacBook-Pro:anchor anderskitson$ rbenv global 1.9.3-p0
Anderss-MacBook-Pro:anchor anderskitson$ ruby --version
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
Anderss-MacBook-Pro:anchor anderskitson$ rbenv version
1.9.3-p0 (set by /Users/anderskitson/.rbenv/version)
Anderss-MacBook-Pro:anchor anderskitson$ 

更新

我为 rbenv global 发布了这个

Anderss-MacBook-Pro:anchor anderskitson$ $ rbenv global 1.9.3-p0
-bash: $: command not found

【问题讨论】:

    标签: ruby version rbenv


    【解决方案1】:

    在使用 rbenv 安装 ruby​​ 版本后,您需要使用 rbenv global 设置您希望 shell 使用的 ruby​​ 版本。

    $ rbenv global 1.9.3-p0
    

    请参阅these docs 了解更多信息。

    【讨论】:

    • 您是否偶然复制了前面的$ 标志?这里只是用来表示这是要在控制台中运行的语句。
    猜你喜欢
    • 2013-01-27
    • 1970-01-01
    • 2018-01-03
    • 1970-01-01
    • 1970-01-01
    • 2013-02-18
    • 2012-02-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多