我正在使用Rails 4.2.3。我正在尝试使此导入在我的“app/assets/stylesheets/profile.css.scss”文件中起作用

@import "compass/css3";

但是我读到我必须先安装 compass gem,然后再进行编译。因此,在安装了gem之后,我运行了此命令
davea$ compass compile
/Users/davea/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:2158:in `method_missing': undefined method `this' for #<Gem::Specification:0x3fcd454385e4  compass-1.0.3> (NoMethodError)
    from /Users/davea/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:1057:in `find_active_stub_by_path'
    from /Users/davea/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:64:in `require'
    from /Users/davea/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/bin/compass:20:in `block in <top (required)>'
    from /Users/davea/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/bin/compass:8:in `fallback_load_path'
    from /Users/davea/.rvm/gems/ruby-2.3.0/gems/compass-1.0.3/bin/compass:19:in `<top (required)>'
    from /Users/davea/.rvm/gems/ruby-2.3.0/bin/compass:23:in `load'
    from /Users/davea/.rvm/gems/ruby-2.3.0/bin/compass:23:in `<main>'
    from /Users/davea/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
    from /Users/davea/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'

根据阅读文档,我被告知我必须创建一个“config.rb”文件,该文件在我的元素根目录中包含该文件。
css_dir =   "css"
sass_dir =  "sass"

但即使我仍然收到上述错误。

最佳答案

尝试将文件命名为compass.rb而不是config.rb

关于css - 为#<Gem::Specification:0x3fcd454385e4 compass 1.0.3>获取 "undefined method `,此操作(NoMethodError )"when running "compass 编译”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38081838/

10-13 06:03