Ruby指南针 - 无法加载此类文件 - 指南针/核心(LoadError)

时间:2016-11-29 11:06:16

标签: ruby-on-rails ruby rubygems rbenv compass

我正在尝试安装和解决罗盘gem,以及我在安装时使用的命令是 -

gem install sass
gem install compass

现在我可以使用命令 -

查看sass的版本
sass --version

但是当我这样做时 -

compass --version

我得到的消息是 -

/home/name/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- compass/core (LoadError)
from /home/name/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/name/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/compass-1.0.3/lib/compass.rb:14:in `block in <top (required)>'
from /home/name/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/compass-1.0.3/lib/compass.rb:13:in `each'
from /home/name/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/compass-1.0.3/lib/compass.rb:13:in `<top (required)>'
from /home/name/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/name/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/name/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/compass-1.0.3/bin/compass:20:in `block in <top (required)>'
from /home/name/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/compass-1.0.3/bin/compass:8:in `fallback_load_path'
from /home/name/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/compass-1.0.3/bin/compass:19:in `<top (required)>'
from /home/name/.rbenv/versions/2.3.1/bin/compass:22:in `load'
from /home/name/.rbenv/versions/2.3.1/bin/compass:22:in `<main>'

我尝试在谷歌搜索并经历了很多关于指南针的github问题和stackoverflow问题,但其中任何一个都无济于事。

我该如何解决这个问题?

更新: - 我被要求在这里包括以下命令的o / p -

gem list -d | grep compass -A 4

O / P: -

    compass (1.0.3)
    Authors: Chris Eppstein, Scott Davis, Eric M. Suzanne, Brandon
    Mathis, Nico Hagenburger
    Homepage: http://compass-style.org
    Installed at: /home/name/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0

    A Real Stylesheet Framework

compass-core (1.0.3)
    Authors: Chris Eppstein, Scott Davis, Eric M. Suzanne, Brandon
    Mathis
    Homepage: http://compass-style.org/reference/compass/
    License: MIT
    Installed at: /home/name/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0

    The Compass core stylesheet library
--
compass-import-once (1.0.5)
    Author: Chris Eppstein
    Homepage:
    https://github.com/chriseppstein/compass/tree/master/import-once
    License: MIT
    Installed at: /home/name/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0

    Speed up your Sass compilation by making @import only import each

1 个答案:

答案 0 :(得分:0)

不再支持Ruby罗盘。最好下车。但是我遇到了同样的问题,只有一个虚拟机,一台装有ruby 2.6.2p47和gem 3.0.3的linux机器,直到最后我看到gem install罗盘没有得到罗盘核心。而在其他版本上,它得到了。解决方案-明确地做到这一点:

gem install compass-core

无论如何-它对我有用,我希望它对其他流浪者有帮助!