安装后无法使用指南针

时间:2014-01-12 19:37:55

标签: ruby ubuntu rvm vagrant compass-sass

我似乎无法使用this Vagrantfile让指南针处理Vagrant。请参阅bash脚本的其余部分右侧 here (已删除的repo)(如果要配置Vagrant Ubuntu Box,请参阅Vaprobash。)。

所以当我不得不使用grunt server时,我正在放弃一个gruntjs课程。唯一的问题是它需要一个更新的红宝石版本(1.9+我相信而不是1.8)它需要指南针。所以我通过安装RVM并安装最新的稳定版本解决了ruby部分。指南针应该很容易获得gem install compass,似乎确实安装了它。但是当我输入compass -v时,我得到了一个错误的错误:

/home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- sass/script/node (LoadError)
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in `<top (required)>'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in `block in <top (required)>'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `each'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `<top (required)>'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in `<top (required)>'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:5:in `block in <top (required)>'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:4:in `each'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:4:in `<top (required)>'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:20:in `block in <top (required)>'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:8:in `fallback_load_path'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:19:in `<top (required)>'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/compass:23:in `load'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/compass:23:in `<main>'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'

所以我不确定会出现什么问题,除了错误告诉我它丢失了文件。任何人都有一些提示可能是什么问题?

.bash_profile包含路径信息:

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

rvm -vruby -v工作正常,安装gem install compass sass -v之后似乎也可以正常工作。

您可以使用Vagrant和VirtualBox复制所有内容。只需从我上面提到的github和vagrant up下载Vagrantfile。

2 个答案:

答案 0 :(得分:85)

我在官方指南针Github问题的页面上寻求帮助,并得到了这个问题的答案。

GitHub问题正确here

如何解决这个问题:

安装指南针(v0.12.2)时,会下载最新的sass v3.3.0.rc3(因为它是依赖项),但指南针不适用于最新的sass。您可以将罗盘升级到最新的alpha版本(0.13。*)或将sass降级为3.2。*。我选择了最后一个:

gem uninstall sass --version 3.3.0.rc.3
gem install sass --version 3.2.18
compass -v # Working :)

确保使用已安装的版本。通过输入以下内容找出:

sass --version

答案 1 :(得分:1)

看看这个答案https://stackoverflow.com/a/21082978/497756 - 这是针对其他问题,但也应该解决你的问题。