gpt4 book ai didi

ruby - 安装后无法使用 compass

转载 作者:数据小太阳 更新时间:2023-10-29 06:26:43 26 4
gpt4 key购买 nike

我似乎无法使用 this Vagrantfile 使 compass 在 Vagrant 上工作.请在 此处 查看其余的 bash 脚本(已删除 repo)(如果您想配置您的 Vagrant Ubuntu Box,请参阅 Vaprobash!)。

因此,当我不得不使用 grunt server 时,我正在学习 gruntjs 类(class)。唯一的问题是它需要更新的 ruby​​ 版本(我相信是 1.9+ 而不是 1.8)并且它需要 compass 。所以我通过安装 RVM 和安装最新的稳定版本解决了 ruby​​ 部分。 compass 应该很容易获得 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 下载 Vagrantfile 并 vagrant up

最佳答案

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

GitHub问题对here .

如何解决这个问题:

安装 compass (v0.12.2) 时,它会下载最新的 sass v3.3.0.rc3(因为它是依赖项),但 compass 不能与最新的 sass 一起使用。您要么将 compass 升级到最新的 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

关于ruby - 安装后无法使用 compass ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21079342/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com