2012-03-28 51 views
6

操作系统:薄荷Linux 11 64位如何使用rvm和gem安装和运行指南针?

我对红宝石一无所知,我只想要指南针。

我已经安装了RVM和Ruby 1.9.3,并通过宝石

$ gem list 

*** LOCAL GEMS *** 

bundler (1.1.3) 
chunky_png (1.2.5) 
compass (0.12.1) 
fssm (0.2.8.1) 
rake (0.9.2) 
rubygems-bundler (0.2.8) 
sass (3.1.15) 

设置默认红宝石

$ rvm list 

rvm rubies 

=* ruby-1.9.3-p125 [ x86_64 ] 

# => - current 
# =* - current && default 
# * - default 

我已经安装了指南针,但我不能运行指南针,因为gem/bin不在$ PATH中

我将它添加到$ PATH并再次运行指南针:

$ compass 
/home/il/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find compass (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError) 
from /home/il/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec' 
from /home/il/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems.rb:1230:in `gem' 
from /home/il/.rvm/gems/ruby-1.9.3-p125/bin/compass:18:in `<main>' 

任何人都可以帮忙吗?

+0

请问您能解释一下,您是如何设法运行您的指南针项目的?当我尝试运行指南针命令时,它向我显示指南针的帮助。 – tokhi 2012-11-06 04:47:55

回答

13

$ rvm wrapper [email protected] --no-prefix compass

+0

谢谢iron9light,工作!开始使用ruby的人可能想要阅读有关rmv gemsets https://rvm.io/gemsets/的内容,应该将其用作避免冲突的最佳做法 – 2012-11-25 14:27:34

11

假设RVM安装,你可以这样做:

$ rvm install 2.1.1 
$ rvm @global do gem install compass 

不需要做须藤。

+0

谢谢!这解决了我的问题 – Maksym 2014-12-29 12:43:09