我已经从命令行在我的Ubuntu机器上安装了ruby1.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$
任何想法可能出错?
答案 0 :(得分:1)
你可以使用update-alternatives做到这个
update-alternatives --set ruby /usr/bin/ruby1.8
获取备选方案列表
update-alternatives --query ruby
更新:对于可能遇到同样问题的用户,请参阅this link
答案 1 :(得分:0)
在'cd'ing之后你能看到/ usr / bin中的ruby吗?您还可以运行 echo $ PATH 以查看您的路径是否设置正确。