安装指南针后无法使用 [英] Can't use compass after installing it

查看:108
本文介绍了安装指南针后无法使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法使用此Vagrantfile 在Vagrant上使用指南针。在此处(已删除的回购)中查看bash脚本的其余使用权(请参阅 Vaprobash

I don't seem to be able to get compass working on Vagrant using this Vagrantfile. See the rest of the bash script's used right here(removed repo) (see Vaprobash if you want to provision your Vagrant Ubuntu Box!).

因此,当我不得不使用 grunt服务器时,我不喜欢gruntjs课程

So I was fallowing a gruntjs course, when I had to use grunt server. The only problem is that it needs a newer ruby version (1.9+ I believe instead of the 1.8) and it needs compass. So I have solved the ruby part by installing RVM and installing the latest stable version. Compass should be easy to get gem install compass and it does seem to be installed. But when I type in compass -v I get the fallowing error:

/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包含路径信息:

.bash_profile contains the path info:

[[ -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 ruby​​ -v 工作正常,并且在安装 gem后安装罗盘 sass -v 似乎也可以工作。

rvm -v and ruby -v work just fine and after installing gem install compass sass -v seem to work as well.

您可以使用流浪汉和VirtualBox。只需从上面提到的我的github下载Vagrantfile,然后 vagrant up

You can replicate everything using Vagrant and VirtualBox. Just download the Vagrantfile from my github mentioned above and vagrant up.

推荐答案

我在官方罗盘Github问题页面上寻求帮助,并得到了该问题的答案。

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.

如何解决此问题:

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

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. You either upgrade compass to the latest alpha version (0.13.*) or downgrade sass to 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

这篇关于安装指南针后无法使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆