获取“<gem :: specification:0x3fcd454385e4 compass-1.0.3 =”“>(NoMethodError)的”未定义方法`this“”运行“指南针编译”

时间:2016-06-28 16:40:45

标签: css css3 ruby-on-rails-4 sass compass

我正在使用Rails 4.2.3。我试图让这个导入工作在我的“app / assets / stylesheets / profile.css.scss”文件中

@import "compass/css3";

但是我读到我必须安装指南针宝石然后编译东西。所以在安装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"

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

2 个答案:

答案 0 :(得分:0)

尝试命名您的文件def product_params params.require(:product).permit(:title, images: []) end 而不是<dropdownlist _ngcontent-lnd-30=""> <select class="form-control ng-pristine ng-valid ng-touched"> <!--template bindings={}--> <option value="null">Selecione um tipo de norma...</option> <option value="5980dfc1-ed08-4e5f-bdd7-144beb2fafe3">Enunciado Orientativo</option> <option value="e721782a-11ba-4828-ac3a-934f60652760">Instrução Normativa</option> <option value="a4469d22-1188-467d-a78a-e385a2cc8eb9">Lei</option> <option value="9d8ea2fd-efe9-410a-8062-f5607c56332d">Portaria</option> <option value="8407a52d-a760-48a2-b780-ab93f5904565">Provimento</option> <option value="8b20cc7f-6be1-43a5-a0b7-ac2fe695b14c">Resolução</option> <option value="8fe058a8-ece3-4ef5-8f74-17255a90066f">Súmula</option> </select></dropdownlist>

答案 1 :(得分:0)

它似乎是版本2.5.1的宝石bug。 降级到宝石2.4.8将正常工作。 gem update --system 2.4.8 --no-ri --no-rdoc https://stackoverflow.com/a/35668630/3004217