宝石没有安装包 [英] Gem not installing package

查看:139
本文介绍了宝石没有安装包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我想安装一个软件包

So I'm trying to install a package

$ sudo gem install compass

具体。它安装正确,并显示出来,当我做一个列表:

to be specific. It installs correctly and shows up when I do a list:

$ gem list

*** LOCAL GEMS ***

chunky_png (1.2.5)
compass (0.12.2)
fssm (0.2.9)
sass (3.1.20)

但由于某些原因,当我尝试运行指南针时,什么也没有发生。它说该命令没有找到。我做错了什么?

but for some reason when I try to run compass nothing happens. It says the command is not found. What am I doing wrong?

$ compass
  bash: compass: command not found

如果有帮助,我正在运行Ubuntu。

I'm running Ubuntu if that helps.

推荐答案

确认输出为 locate -r /compass.rb $ ,然后 echo $ GEM_HOME 。您应该发现 gem 不知道安装到 compass 的目录。您可以将它从原来的位置移动到由 GEM_HOME 指定的目录中,或者将该目录附加到〜/ .bash_rc 文件。不过,更好的办法是使用 rvm 来管理您的宝石(和红宝石),因为它很好地避免了这类问题,并且还可以更好地控制整个过程。

Confirm that there is output for locate -r /compass.rb$, then echo $GEM_HOME. You should find that gem doesn't know about the directory that compass installed to. You can either move it from its previous location into the directory specified by GEM_HOME, or else append that directory to the variable in your ~/.bash_rc file. Much better, though, would be to use rvm for managing your gems (and Rubies), as it neatly avoids this sort of issue and also allows much finer control over the whole process.

这篇关于宝石没有安装包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆