【问题标题】:Ruby command not working after installing Ruby 2.0 through RVM on Linux mint 17.2在 Linux mint 17.2 上通过 RVM 安装 Ruby 2.0 后,Ruby 命令不起作用
【发布时间】:2015-07-17 00:34:40
【问题描述】:

我尝试通过 RVM 安装 Ruby 2.0。好像我安装了 Ruby 没有任何问题。但是,当我输入 ruby -v 时,什么也没有出现。我认为命令 ruby​​ 尚未设置。

我想知道如何使用“ruby -v”。

<blink>
kyu@kyu-Latitude-D430 ~ $ rvm install ruby 2.0.0                                                    Searching for binary rubies, this might take some time.
No binary rubies available for: mint/17.2/x86_64/ruby-2.0.0-p643.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for mint.
Installing requirements for mint.
Updating system............
Installing required packages: g++, libreadline6-dev, zlib1g-dev, libssl-dev, libyaml-dev, libsqlite3-dev, sqlite3, autoconf, libgdbm-dev, libncurses5-dev, automake, libtool, libffi-dev..............
Requirements installation successful.
Installing Ruby from source to: /home/kyu/.rvm/rubies/ruby-2.0.0-p643, this may take a while depending on your cpu(s)...
ruby-2.0.0-p643 - #downloading ruby-2.0.0-p643, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10.2M  100 10.2M    0     0  1139k      0  0:00:09  0:00:09 --:--:-- 1473k
ruby-2.0.0-p643 - #extracting ruby-2.0.0-p643 to /home/kyu/.rvm/src/ruby-2.0.0-p643....
ruby-2.0.0-p643 - #configuring..................................................
ruby-2.0.0-p643 - #post-configuration..
ruby-2.0.0-p643 - #compiling................................................................................
ruby-2.0.0-p643 - #installing..............................
ruby-2.0.0-p643 - #making binaries executable..
ruby-2.0.0-p643 - #downloading rubygems-2.4.8
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  437k  100  437k    0     0   225k      0  0:00:01  0:00:01 --:--:--  225k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.0.0-p643 - #extracting rubygems-2.4.8....
ruby-2.0.0-p643 - #removing old rubygems.........
ruby-2.0.0-p643 - #installing rubygems-2.4.8......................
ruby-2.0.0-p643 - #gemset created /home/kyu/.rvm/gems/ruby-2.0.0-p643@global
ruby-2.0.0-p643 - #importing gemset /home/kyu/.rvm/gemsets/global.gems...............................................
ruby-2.0.0-p643 - #generating global wrappers........
ruby-2.0.0-p643 - #gemset created /home/kyu/.rvm/gems/ruby-2.0.0-p643
ruby-2.0.0-p643 - #importing gemsetfile /home/kyu/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.0.0-p643 - #generating default wrappers........
ruby-2.0.0-p643 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.0.0-p643 - #complete 
Ruby was built without documentation, to build it run: rvm docs generate-ri
kyu@kyu-Latitude-D430 ~ $ ruby -v
bash: /usr/bin/ruby: No such file or directory <code>
<blink>

【问题讨论】:

  • source ~/.rvm/scripts/rvm了吗?

标签: ruby installation rvm


【解决方案1】:

你应该有类似的东西

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

在您的 .profile 文件中。

如果它在那里,你可能没有启动一个新的登录 shell,因为它被添加了,所以只需手动获取它。

那么你应该会看到一些与 ruby​​ 相关的路径

echo $PATH

【讨论】:

    猜你喜欢
    • 2012-04-05
    • 2013-12-03
    • 1970-01-01
    • 1970-01-01
    • 2013-07-11
    • 1970-01-01
    • 2012-05-27
    • 1970-01-01
    • 2013-08-16
    相关资源
    最近更新 更多