简体   繁体   English

安装后无法使用指南针

[英]Can't use compass after installing it

I don't seem to be able to get compass working on Vagrant using this Vagrantfile . 我似乎无法使用 Vagrant文​​件使用指南针处理Vagrant。 See the rest of the bash script's used right here (removed repo) (see Vaprobash if you want to provision your Vagrant Ubuntu Box!). 请参阅 此处 使用的其余bash脚本(已删除的repo)(如果要配置Vagrant Ubuntu Box,请参阅Vaprobash !)。

So I was fallowing a gruntjs course, when I had to use grunt server . 因此,当我不得不使用grunt server时,我正在停止gruntjs课程。 The only problem is that it needs a newer ruby version (1.9+ I believe instead of the 1.8) and it needs compass. 唯一的问题是它需要一个更新的红宝石版本(1.9+我相信而不是1.8)它需要指南针。 So I have solved the ruby part by installing RVM and installing the latest stable version. 所以我通过安装RVM并安装最新的稳定版本解决了ruby部分。 Compass should be easy to get gem install compass and it does seem to be installed. 指南针应该很容易获得gem install compass ,它似乎确实安装。 But when I type in compass -v I get the fallowing error: 但是当我输入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>'

So I am not sure what is going wrong except for the error telling me it's missing files. 所以我不确定会出现什么问题,除了错误告诉我它丢失了文件。 Anyone got some hints to what could be the problem? 任何人都有一些提示可能是什么问题?

.bash_profile contains the path info: .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 -v and ruby -v work just fine and after installing gem install compass sass -v seem to work as well. rvm -vruby -v工作得很好,安装gem install compass sass -v似乎也能正常工作。

You can replicate everything using Vagrant and VirtualBox. 您可以使用Vagrant和VirtualBox复制所有内容。 Just download the Vagrantfile from my github mentioned above and vagrant up . 只需从我上面提到的github下载Vagrantfile并进行vagrant up

I asked for help on the official compass Github issue's page and got the answer for this problem. 我在官方指南针Github问题的页面上寻求帮助,并得到了这个问题的答案。

The GitHub issue is right here . GitHub问题就在这里

How to fix this: 如何解决这个问题:

When installing compass (v0.12.2), it will download the latest sass v3.3.0.rc3 (cause it's a dependency), but compass won't work with the latest sass. 安装指南针(v0.12.2)时,它会下载最新的sass v3.3.0.rc3(因为它是一个依赖项),但指南针不适用于最新的sass。 You either upgrade compass to the latest alpha version (0.13.*) or downgrade sass to 3.2.*. 您可以将罗盘升级到最新的alpha版本(0.13。*)或将sass降级为3.2。*。 I choose the last one: 我选择最后一个:

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

Make sure you use the version you got installed. 确保使用已安装的版本。 Find out by typing this: 通过输入以下内容找出:

sass --version

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM