Gem not installing package

偶尔善良 提交于 2019-12-23 22:35:05

问题


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

I'm running Ubuntu if that helps.


回答1:


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.




回答2:


This problem can be solved by follwing this:

http://markushedlund.com/dev-tech/ubuntu-compass-command-not-found

The problem is concerned about the global variable PATH that is not being updated correctly when installing gem compass

Run

echo "PATH=\$PATH:/var/lib/gems/1.8/bin:\$HOME/.gem/ruby/1.8/bin" >> /etc/profile.d/rubygems1.8.sh

and re-login



来源:https://stackoverflow.com/questions/11680416/gem-not-installing-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!