I'm trying to install Ruby on CentOS 6.3 I've installed the ruby-1.9.3-p286 from source. However once completed, I tried doing gem -v to verify that gems was installed and I get /usr/bin/gem: No such file or directory. I thought this version of ruby would have automatically installed gems. Am I doing something wrong?
我正在尝试在CentOS 6.3上安装Ruby我已经从源代码安装了ruby-1.9.3-p286。但是一旦完成,我尝试使用gem -v来验证gems是否已安装,我得到/ usr / bin / gem:没有这样的文件或目录。我以为这个版本的ruby会自动安装宝石。难道我做错了什么?
1 个解决方案
#1
3
Unless you supplied a --prefix
directory before building it, Ruby (at least that version - couldn't say for sure about other versions) will install things in /usr/local
. That would mean gem
lives at /usr/local/bin/gem
.
除非你在构建它之前提供了--prefix目录,否则Ruby(至少那个版本 - 不能肯定地说其他版本)将在/ usr / local中安装。这意味着宝石生活在/ usr / local / bin / gem。
If that file is there, you might want to consider adding /usr/local/bin
to your path:
如果该文件存在,您可能需要考虑在路径中添加/ usr / local / bin:
# ~/.bashrc (or equivalent):
export PATH=/usr/local/bin:$PATH
#1
3
Unless you supplied a --prefix
directory before building it, Ruby (at least that version - couldn't say for sure about other versions) will install things in /usr/local
. That would mean gem
lives at /usr/local/bin/gem
.
除非你在构建它之前提供了--prefix目录,否则Ruby(至少那个版本 - 不能肯定地说其他版本)将在/ usr / local中安装。这意味着宝石生活在/ usr / local / bin / gem。
If that file is there, you might want to consider adding /usr/local/bin
to your path:
如果该文件存在,您可能需要考虑在路径中添加/ usr / local / bin:
# ~/.bashrc (or equivalent):
export PATH=/usr/local/bin:$PATH