ruby和gems已安装,但sass gem不工作

ruby和gems已安装,但sass gem不工作,ruby,gem,sass,Ruby,Gem,Sass,我知道我已经安装了ruby和gem,因为我以前安装过很多gem。另外,当我执行以下操作时 ~$ ruby --version ruby 1.8.7 (2010-08-16 patchlevel 302 [i486-linux] ~$ gem --version 1.3.7 b2json capify fog html2haml nokogiri rails

我知道我已经安装了ruby和gem,因为我以前安装过很多gem。另外,当我执行以下操作时

~$ ruby --version
ruby 1.8.7 (2010-08-16 patchlevel 302 [i486-linux]

~$ gem --version
1.3.7
b2json              capify              fog                 html2haml           nokogiri            rails               ri                  sass-convert        therubyracer        tilt
bundle              coderay             geocode             httpclient          oauth               rake2thor           ruby_noexec_wrapper scss                thin                tt
cap                 erubis              haml                j2bson              rackup              rdoc                sass                sprockets           thor
正如你所看到的,他们返回了这个版本——但是当我尝试这样做的时候--

b2json              capify              fog                 html2haml           nokogiri            rails               ri                  sass-convert        therubyracer        tilt
bundle              coderay             geocode             httpclient          oauth               rake2thor           ruby_noexec_wrapper scss                thin                tt
cap                 erubis              haml                j2bson              rackup              rdoc                sass                sprockets           thor
我对任何事物都是一个相对的noob,但对ruby和gems来说,我更是一个noob。为了或多或少地展示我对事物的理解水平,我对Debian已经有了足够的了解,可以在一个环境中运行Clojure并让web应用程序正常工作(这花费了我将近一年的业余时间——我以前对编程几乎一无所知)。我正试图让sass工作,以减轻我在网页设计方面的精神负担,而我只是在这方面遇到了麻烦

b2json              capify              fog                 html2haml           nokogiri            rails               ri                  sass-convert        therubyracer        tilt
bundle              coderay             geocode             httpclient          oauth               rake2thor           ruby_noexec_wrapper scss                thin                tt
cap                 erubis              haml                j2bson              rackup              rdoc                sass                sprockets           thor
这会是一个路径问题吗?如果是这样的话,需要在路径上做什么才能让一个gem工作--

b2json              capify              fog                 html2haml           nokogiri            rails               ri                  sass-convert        therubyracer        tilt
bundle              coderay             geocode             httpclient          oauth               rake2thor           ruby_noexec_wrapper scss                thin                tt
cap                 erubis              haml                j2bson              rackup              rdoc                sass                sprockets           thor
顺便说一句,当我安装sass时会发生什么--

b2json              capify              fog                 html2haml           nokogiri            rails               ri                  sass-convert        therubyracer        tilt
bundle              coderay             geocode             httpclient          oauth               rake2thor           ruby_noexec_wrapper scss                thin                tt
cap                 erubis              haml                j2bson              rackup              rdoc                sass                sprockets           thor
任何人能给予的任何帮助都将不胜感激。我整天都在做这件事,一辈子都搞不懂

justin ⮀ ~ ⮀ gem install sass  
Fetching: sass-3.2.5.gem (100%)
Successfully installed sass-3.2.5
1 gem installed

justin ⮀ ~ ⮀ sass -v
Sass 3.2.5 (Media Mark)
b2json              capify              fog                 html2haml           nokogiri            rails               ri                  sass-convert        therubyracer        tilt
bundle              coderay             geocode             httpclient          oauth               rake2thor           ruby_noexec_wrapper scss                thin                tt
cap                 erubis              haml                j2bson              rackup              rdoc                sass                sprockets           thor
我觉得还可以。我会检查你的路线

b2json              capify              fog                 html2haml           nokogiri            rails               ri                  sass-convert        therubyracer        tilt
bundle              coderay             geocode             httpclient          oauth               rake2thor           ruby_noexec_wrapper scss                thin                tt
cap                 erubis              haml                j2bson              rackup              rdoc                sass                sprockets           thor
正确的路径取决于gems的安装位置。我使用RVM,因此会有所不同。您可以尝试在加载rubygems的ruby代码中抛出异常,这应该为您提供一个起点

> rails c
Loading development environment (Rails 3.2.11)
1.9.3p362 :001 > throw test



ArgumentError: wrong number of arguments (0 for 2..3)
        from (irb):1:in `test'
        from (irb):1
        from /Users/justin/.rvm/gems/ruby-1.9.3-p362@rails3.2/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in `start'
        from /Users/justin/.rvm/gems/ruby-1.9.3-p362@rails3.2/gems/railties-3.2.11/lib/rails/commands/console.rb:8:in `start'
        from /Users/justin/.rvm/gems/ruby-1.9.3-p362@rails3.2/gems/railties-3.2.11/lib/rails/commands.rb:41:in `<top (required)>'
        from script/rails:5:in `require'
        from script/rails:5:in `<main>'
b2json              capify              fog                 html2haml           nokogiri            rails               ri                  sass-convert        therubyracer        tilt
bundle              coderay             geocode             httpclient          oauth               rake2thor           ruby_noexec_wrapper scss                thin                tt
cap                 erubis              haml                j2bson              rackup              rdoc                sass                sprockets           thor
胡言乱语

b2json              capify              fog                 html2haml           nokogiri            rails               ri                  sass-convert        therubyracer        tilt
bundle              coderay             geocode             httpclient          oauth               rake2thor           ruby_noexec_wrapper scss                thin                tt
cap                 erubis              haml                j2bson              rackup              rdoc                sass                sprockets           thor
所以在我的例子中,我想添加
/Users/justin/.rvm/gems/ruby-1.9.3-p362@rails3.2/银行标识代码

b2json              capify              fog                 html2haml           nokogiri            rails               ri                  sass-convert        therubyracer        tilt
bundle              coderay             geocode             httpclient          oauth               rake2thor           ruby_noexec_wrapper scss                thin                tt
cap                 erubis              haml                j2bson              rackup              rdoc                sass                sprockets           thor

但是我使用RVM,所以它可以为我做到这一点。

试着找出Sass安装在哪里。在我的例子中,gem路径是

b2json              capify              fog                 html2haml           nokogiri            rails               ri                  sass-convert        therubyracer        tilt
bundle              coderay             geocode             httpclient          oauth               rake2thor           ruby_noexec_wrapper scss                thin                tt
cap                 erubis              haml                j2bson              rackup              rdoc                sass                sprockets           thor
[~] which gem
/usr/bin/gem
但是Sass安装在另一个路径中,该路径不在我的$path中

b2json              capify              fog                 html2haml           nokogiri            rails               ri                  sass-convert        therubyracer        tilt
bundle              coderay             geocode             httpclient          oauth               rake2thor           ruby_noexec_wrapper scss                thin                tt
cap                 erubis              haml                j2bson              rackup              rdoc                sass                sprockets           thor
[~] find . -name '*sass*'
./ruby/gems/doc/sass-3.4.22/rdoc/lib/sass
./ruby/gems/gems/sass-3.4.22/test/sass
./ruby/gems/gems/sass-3.4.22/bin/sass
./ruby/gems/gems/sass-3.4.22/lib/sass
./ruby/gems/bin/sass

因此,我需要的是将$HOME/ruby/gems/bin添加到我的$PATH中;然后,它解决了问题。

可能是路径问题。您是否尝试过自动完成
sass
命令?在我的开发机器上,gems有一个“19”后缀表示Ruby 1.9,因此我运行的命令是
sass19
compass19
。您是否已将sass安装为su?谢谢!这让我的目标正确,让它工作!我爱你!
b2json              capify              fog                 html2haml           nokogiri            rails               ri                  sass-convert        therubyracer        tilt
bundle              coderay             geocode             httpclient          oauth               rake2thor           ruby_noexec_wrapper scss                thin                tt
cap                 erubis              haml                j2bson              rackup              rdoc                sass                sprockets           thor