5

I’m using Rails 4.2.3. I’m trying to get this import to work in my “app/assets/stylesheets/profile.css.scss” file

@import "compass/css3";

but I read that I have to install the compass gem and then compile things. So after installing the gem, I ran this command

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>'

Per reading documentation, I was told I had to create a “config.rb” file, which I did in my project root directory, containing this

css_dir =   "css"
sass_dir =  "sass"

but even still I get the above error.

Dave
  • 15,639
  • 133
  • 442
  • 830

2 Answers2

0

Try naming your file compass.rb instead of config.rb.

MMachinegun
  • 3,044
  • 2
  • 27
  • 44
  • Changed the name of the file to "compass.rb" but got the same error. What directory si this file spuposed to be in? – Dave Jul 01 '16 at 17:02
  • in the config folder – MMachinegun Jul 01 '16 at 17:17
  • K, even putting it in the config folder, whether its named "config.rb" or "compass.rb" results in the "in `method_missing': undefined method `this' for # (NoMethodError)" error upon running "compass compile" – Dave Jul 01 '16 at 19:53
  • hm, then I'm not sure what the problem might be. If I come up with an other idea I'll let you know – MMachinegun Jul 01 '16 at 20:00
0

It seems like a gem bug for version 2.5.1. Downgrade to gem 2.4.8 will work fine. gem update --system 2.4.8 --no-ri --no-rdoc https://stackoverflow.com/a/35668630/3004217

Community
  • 1
  • 1
angeldsWang
  • 123
  • 1
  • 7