0

我已经从命令行在我的 Ubuntu 机器上安装了 ruby​​1.8。但是系统显示没有安装ruby。

这是控制台输出:

frank@my-version3:~/apps$ sudo apt-get install ruby1.8 ruby1.8-dev irb rdoc ri
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ruby1.8 is already the newest version.
ruby1.8-dev is already the newest version.
irb is already the newest version.
rdoc is already the newest version.
ri is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

frank@my-version3:~/apps$ which ruby

frank@my-version3:~/apps$ ruby -v
-bash: ruby: command not found

frank@my-version3:~/apps$ ruby
-bash: ruby: command not found

frank@my-version3:~/apps$ irb
irb(main):001:0> exit

frank@my-version3:~/apps$ 

有什么想法可能是错的吗?

4

2 回答 2

1

你可以使用 update-alternatives 做这个

update-alternatives --set ruby /usr/bin/ruby1.8 

获取替代品列表

update-alternatives --query ruby

更新:对于可能遇到相同问题的用户,请参阅此链接

于 2013-02-05T14:25:49.187 回答
0

在“cd”之后你能在 /usr/bin 中看到 ruby​​ 吗?您还可以运行echo $PATH以查看您的路径是否设置正确。

于 2013-02-05T13:54:48.177 回答