New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sass-rails and compass *_url helpers conflict #630

Closed
agibralter opened this Issue Nov 22, 2011 · 28 comments

Comments

Projects
None yet
8 participants
@agibralter
Contributor

agibralter commented Nov 22, 2011

Both sass-rails and compass define Sass helper functions with the same names:

https://github.com/rails/sass-rails/blob/master/lib/sass/rails/helpers.rb#L29-35
https://github.com/chriseppstein/compass/blob/stable/lib/compass/sass_extensions/functions/urls.rb#L24-49

Are they meant to be able to work together? Is there any point in having the two together?

@scottdavis

This comment has been minimized.

Show comment
Hide comment
@scottdavis

scottdavis Nov 22, 2011

Member

One overrides the other this is on purpose

Sent from my iPhone

On Nov 22, 2011, at 1:28 PM, Aaron Gibralterreply@reply.github.com wrote:

Both sass-rails and compass define Sass helper functions with the same names:

https://github.com/rails/sass-rails/blob/master/lib/sass/rails/helpers.rb#L29-35
https://github.com/chriseppstein/compass/blob/stable/lib/compass/sass_extensions/functions/urls.rb#L24-49

Are they meant to be able to work together? Is there any point in having the two together?


Reply to this email directly or view it on GitHub:
#630

Member

scottdavis commented Nov 22, 2011

One overrides the other this is on purpose

Sent from my iPhone

On Nov 22, 2011, at 1:28 PM, Aaron Gibralterreply@reply.github.com wrote:

Both sass-rails and compass define Sass helper functions with the same names:

https://github.com/rails/sass-rails/blob/master/lib/sass/rails/helpers.rb#L29-35
https://github.com/chriseppstein/compass/blob/stable/lib/compass/sass_extensions/functions/urls.rb#L24-49

Are they meant to be able to work together? Is there any point in having the two together?


Reply to this email directly or view it on GitHub:
#630

@agibralter

This comment has been minimized.

Show comment
Hide comment
@agibralter

agibralter Nov 22, 2011

Contributor

@scottdavis -- which overrides which? I'm trying to use font-url(..., true) but rake assets:precompile is telling me wrong number of arguments (2 for 1) for 'font-url'

Contributor

agibralter commented Nov 22, 2011

@scottdavis -- which overrides which? I'm trying to use font-url(..., true) but rake assets:precompile is telling me wrong number of arguments (2 for 1) for 'font-url'

@agibralter

This comment has been minimized.

Show comment
Hide comment
@agibralter

agibralter Nov 22, 2011

Contributor

Basically I was trying to end up with:

@font-face {
    font-family: 'ChunkFiveRegular';
    src: url('Chunkfive-webfont.eot');
    src: url('Chunkfive-webfont.eot?#iefix') format('embedded-opentype'),
         url('Chunkfive-webfont.woff') format('woff'),
         url('Chunkfive-webfont.ttf') format('truetype'),
         url('Chunkfive-webfont.svg#ChunkFiveRegular') format('svg');
    font-weight: normal;
    font-style: normal;
}

Using sass-rails helpers (apparently that's what seems to have priority), I was able to achieve that by doing:

@font-face {
  font-family: 'ChunkFiveRegular';
  src: url(font-path('Chunkfive-webfont.eot'));
  src: url(font-path('Chunkfive-webfont.eot') + '?#iefix') format('embedded-opentype'),
       url(font-path('Chunkfive-webfont.woff')) format('woff'),
       url(font-path('Chunkfive-webfont.ttf')) format('truetype'),
       url(font-path('Chunkfive-webfont.svg') + '#ChunkFiveRegular') format('svg');
  font-weight: normal;
  font-style: normal;
}
Contributor

agibralter commented Nov 22, 2011

Basically I was trying to end up with:

@font-face {
    font-family: 'ChunkFiveRegular';
    src: url('Chunkfive-webfont.eot');
    src: url('Chunkfive-webfont.eot?#iefix') format('embedded-opentype'),
         url('Chunkfive-webfont.woff') format('woff'),
         url('Chunkfive-webfont.ttf') format('truetype'),
         url('Chunkfive-webfont.svg#ChunkFiveRegular') format('svg');
    font-weight: normal;
    font-style: normal;
}

Using sass-rails helpers (apparently that's what seems to have priority), I was able to achieve that by doing:

@font-face {
  font-family: 'ChunkFiveRegular';
  src: url(font-path('Chunkfive-webfont.eot'));
  src: url(font-path('Chunkfive-webfont.eot') + '?#iefix') format('embedded-opentype'),
       url(font-path('Chunkfive-webfont.woff')) format('woff'),
       url(font-path('Chunkfive-webfont.ttf')) format('truetype'),
       url(font-path('Chunkfive-webfont.svg') + '#ChunkFiveRegular') format('svg');
  font-weight: normal;
  font-style: normal;
}
@scottdavis

This comment has been minimized.

Show comment
Hide comment
@scottdavis

scottdavis Nov 22, 2011

Member

Are you using the latest alpha?

Sent from my iPhone

On Nov 22, 2011, at 1:53 PM, Aaron Gibralterreply@reply.github.com wrote:

Basically I was trying to end up with:

@font-face {
   font-family: 'ChunkFiveRegular';
   src: url('Chunkfive-webfont.eot');
   src: url('Chunkfive-webfont.eot?#iefix') format('embedded-opentype'),
        url('Chunkfive-webfont.woff') format('woff'),
        url('Chunkfive-webfont.ttf') format('truetype'),
        url('Chunkfive-webfont.svg#ChunkFiveRegular') format('svg');
   font-weight: normal;
   font-style: normal;
}

Using sass-rails helpers (apparently that's what seems to have priority), I was able to achieve that by doing:

@font-face {
 font-family: 'ChunkFiveRegular';
 src: url(font-path('Chunkfive-webfont.eot'));
 src: url(font-path('Chunkfive-webfont.eot') + '?#iefix') format('embedded-opentype'),
      url(font-path('Chunkfive-webfont.woff')) format('woff'),
      url(font-path('Chunkfive-webfont.ttf')) format('truetype'),
      url(font-path('Chunkfive-webfont.svg') + '#ChunkFiveRegular') format('svg');
 font-weight: normal;
 font-style: normal;
}

Reply to this email directly or view it on GitHub:
#630 (comment)

Member

scottdavis commented Nov 22, 2011

Are you using the latest alpha?

Sent from my iPhone

On Nov 22, 2011, at 1:53 PM, Aaron Gibralterreply@reply.github.com wrote:

Basically I was trying to end up with:

@font-face {
   font-family: 'ChunkFiveRegular';
   src: url('Chunkfive-webfont.eot');
   src: url('Chunkfive-webfont.eot?#iefix') format('embedded-opentype'),
        url('Chunkfive-webfont.woff') format('woff'),
        url('Chunkfive-webfont.ttf') format('truetype'),
        url('Chunkfive-webfont.svg#ChunkFiveRegular') format('svg');
   font-weight: normal;
   font-style: normal;
}

Using sass-rails helpers (apparently that's what seems to have priority), I was able to achieve that by doing:

@font-face {
 font-family: 'ChunkFiveRegular';
 src: url(font-path('Chunkfive-webfont.eot'));
 src: url(font-path('Chunkfive-webfont.eot') + '?#iefix') format('embedded-opentype'),
      url(font-path('Chunkfive-webfont.woff')) format('woff'),
      url(font-path('Chunkfive-webfont.ttf')) format('truetype'),
      url(font-path('Chunkfive-webfont.svg') + '#ChunkFiveRegular') format('svg');
 font-weight: normal;
 font-style: normal;
}

Reply to this email directly or view it on GitHub:
#630 (comment)

@agibralter

This comment has been minimized.

Show comment
Hide comment
@agibralter

agibralter Nov 22, 2011

Contributor

Yup. Here is my Gemfile:

source 'http://rubygems.org'

gem 'rails',      '3.1.3'

# ...

gem 'haml',       '3.1.3'
gem 'compass',    '0.12.alpha.1'
gem 'oily_png',   '1.0.2'
gem 'chunky_png', '1.2.5'

group :assets do
  gem 'sass-rails',         '3.1.5'
  gem 'coffee-rails',       '3.1.1'
  gem 'jquery-rails',       '1.0.18'
  gem 'uglifier',           '1.1.0'
  gem 'compass-960-plugin', '0.10.4', require: 'ninesixty'
end

# ... test stuff
Contributor

agibralter commented Nov 22, 2011

Yup. Here is my Gemfile:

source 'http://rubygems.org'

gem 'rails',      '3.1.3'

# ...

gem 'haml',       '3.1.3'
gem 'compass',    '0.12.alpha.1'
gem 'oily_png',   '1.0.2'
gem 'chunky_png', '1.2.5'

group :assets do
  gem 'sass-rails',         '3.1.5'
  gem 'coffee-rails',       '3.1.1'
  gem 'jquery-rails',       '1.0.18'
  gem 'uglifier',           '1.1.0'
  gem 'compass-960-plugin', '0.10.4', require: 'ninesixty'
end

# ... test stuff
@scottdavis

This comment has been minimized.

Show comment
Hide comment
@scottdavis

scottdavis Nov 22, 2011

Member

Put compass under sass-rails in the assets group

Sent from my iPhone

On Nov 22, 2011, at 2:11 PM, Aaron Gibralterreply@reply.github.com wrote:

Yup. Here is my Gemfile:

source 'http://rubygems.org'

gem 'rails',      '3.1.3'

# ...

gem 'haml',       '3.1.3'
gem 'compass',    '0.12.alpha.1'
gem 'oily_png',   '1.0.2'
gem 'chunky_png', '1.2.5'

group :assets do
 gem 'sass-rails',         '3.1.5'
 gem 'coffee-rails',       '3.1.1'
 gem 'jquery-rails',       '1.0.18'
 gem 'uglifier',           '1.1.0'
 gem 'compass-960-plugin', '0.10.4', require: 'ninesixty'
end

# ... test stuff

Reply to this email directly or view it on GitHub:
#630 (comment)

Member

scottdavis commented Nov 22, 2011

Put compass under sass-rails in the assets group

Sent from my iPhone

On Nov 22, 2011, at 2:11 PM, Aaron Gibralterreply@reply.github.com wrote:

Yup. Here is my Gemfile:

source 'http://rubygems.org'

gem 'rails',      '3.1.3'

# ...

gem 'haml',       '3.1.3'
gem 'compass',    '0.12.alpha.1'
gem 'oily_png',   '1.0.2'
gem 'chunky_png', '1.2.5'

group :assets do
 gem 'sass-rails',         '3.1.5'
 gem 'coffee-rails',       '3.1.1'
 gem 'jquery-rails',       '1.0.18'
 gem 'uglifier',           '1.1.0'
 gem 'compass-960-plugin', '0.10.4', require: 'ninesixty'
end

# ... test stuff

Reply to this email directly or view it on GitHub:
#630 (comment)

@agibralter

This comment has been minimized.

Show comment
Hide comment
@agibralter

agibralter Nov 22, 2011

Contributor

Hmm still doesn't work -- I still get wrong number of arguments (2 for 1) for font-url

Contributor

agibralter commented Nov 22, 2011

Hmm still doesn't work -- I still get wrong number of arguments (2 for 1) for font-url

@agibralter

This comment has been minimized.

Show comment
Hide comment
@agibralter

agibralter Nov 22, 2011

Contributor

And what's the point of compass's font-url('foo', true) method anyway when sass-rails provides font-path?

Contributor

agibralter commented Nov 22, 2011

And what's the point of compass's font-url('foo', true) method anyway when sass-rails provides font-path?

@agibralter

This comment has been minimized.

Show comment
Hide comment
@agibralter

agibralter Nov 22, 2011

Contributor

This is what I was trying to do to get the ?#iefix and #ChunkFiveRegular suffixes in the font urls with digests:

@font-face {
  font-family: 'ChunkFiveRegular';
  src: font-url('Chunkfive-webfont.eot');
  src: url(font-url('Chunkfive-webfont.eot', true) + '?#iefix') format('embedded-opentype'),
       font-url('Chunkfive-webfont.woff') format('woff'),
       font-url('Chunkfive-webfont.ttf') format('truetype'),
       url(font-url('Chunkfive-webfont.svg', true) + '#ChunkFiveRegular') format('svg');
  font-weight: normal;
  font-style: normal;
}

It seems like my pure sass-rails approach works:

@font-face {
  font-family: 'ChunkFiveRegular';
  src: url(font-path('Chunkfive-webfont.eot'));
  src: url(font-path('Chunkfive-webfont.eot') + '?#iefix') format('embedded-opentype'),
       url(font-path('Chunkfive-webfont.woff')) format('woff'),
       url(font-path('Chunkfive-webfont.ttf')) format('truetype'),
       url(font-path('Chunkfive-webfont.svg') + '#ChunkFiveRegular') format('svg');
  font-weight: normal;
  font-style: normal;
}

Is there a reason for compass to have font-url at all? Is it just for non-rails projects? Would it make sense to suppress these conflicting compass helpers in Rails 3.1+ projects?

Contributor

agibralter commented Nov 22, 2011

This is what I was trying to do to get the ?#iefix and #ChunkFiveRegular suffixes in the font urls with digests:

@font-face {
  font-family: 'ChunkFiveRegular';
  src: font-url('Chunkfive-webfont.eot');
  src: url(font-url('Chunkfive-webfont.eot', true) + '?#iefix') format('embedded-opentype'),
       font-url('Chunkfive-webfont.woff') format('woff'),
       font-url('Chunkfive-webfont.ttf') format('truetype'),
       url(font-url('Chunkfive-webfont.svg', true) + '#ChunkFiveRegular') format('svg');
  font-weight: normal;
  font-style: normal;
}

It seems like my pure sass-rails approach works:

@font-face {
  font-family: 'ChunkFiveRegular';
  src: url(font-path('Chunkfive-webfont.eot'));
  src: url(font-path('Chunkfive-webfont.eot') + '?#iefix') format('embedded-opentype'),
       url(font-path('Chunkfive-webfont.woff')) format('woff'),
       url(font-path('Chunkfive-webfont.ttf')) format('truetype'),
       url(font-path('Chunkfive-webfont.svg') + '#ChunkFiveRegular') format('svg');
  font-weight: normal;
  font-style: normal;
}

Is there a reason for compass to have font-url at all? Is it just for non-rails projects? Would it make sense to suppress these conflicting compass helpers in Rails 3.1+ projects?

@scottdavis

This comment has been minimized.

Show comment
Hide comment
@scottdavis

scottdavis Nov 22, 2011

Member

Compass will not re define them if they exist but you need to make sure sass-rails is loaded before compass

Sent from my iPhone

On Nov 22, 2011, at 2:27 PM, Aaron Gibralterreply@reply.github.com wrote:

This is what I was trying to do to get the ?#iefix and #ChunkFiveRegular suffixes in the font urls with digests:

@font-face {
 font-family: 'ChunkFiveRegular';
 src: font-url('Chunkfive-webfont.eot');
 src: url(font-url('Chunkfive-webfont.eot', true) + '?#iefix') format('embedded-opentype'),
      font-url('Chunkfive-webfont.woff') format('woff'),
      font-url('Chunkfive-webfont.ttf') format('truetype'),
      url(font-url('Chunkfive-webfont.svg', true) + '#ChunkFiveRegular') format('svg');
 font-weight: normal;
 font-style: normal;
}

It seems like my pure sass-rails approach works:

@font-face {
 font-family: 'ChunkFiveRegular';
 src: url(font-path('Chunkfive-webfont.eot'));
 src: url(font-path('Chunkfive-webfont.eot') + '?#iefix') format('embedded-opentype'),
      url(font-path('Chunkfive-webfont.woff')) format('woff'),
      url(font-path('Chunkfive-webfont.ttf')) format('truetype'),
      url(font-path('Chunkfive-webfont.svg') + '#ChunkFiveRegular') format('svg');
 font-weight: normal;
 font-style: normal;
}

Is there a reason for compass to have font-url at all? Is it just for non-rails projects? Would it make sense to suppress these conflicting compass helpers in Rails 3.1+ projects?


Reply to this email directly or view it on GitHub:
#630 (comment)

Member

scottdavis commented Nov 22, 2011

Compass will not re define them if they exist but you need to make sure sass-rails is loaded before compass

Sent from my iPhone

On Nov 22, 2011, at 2:27 PM, Aaron Gibralterreply@reply.github.com wrote:

This is what I was trying to do to get the ?#iefix and #ChunkFiveRegular suffixes in the font urls with digests:

@font-face {
 font-family: 'ChunkFiveRegular';
 src: font-url('Chunkfive-webfont.eot');
 src: url(font-url('Chunkfive-webfont.eot', true) + '?#iefix') format('embedded-opentype'),
      font-url('Chunkfive-webfont.woff') format('woff'),
      font-url('Chunkfive-webfont.ttf') format('truetype'),
      url(font-url('Chunkfive-webfont.svg', true) + '#ChunkFiveRegular') format('svg');
 font-weight: normal;
 font-style: normal;
}

It seems like my pure sass-rails approach works:

@font-face {
 font-family: 'ChunkFiveRegular';
 src: url(font-path('Chunkfive-webfont.eot'));
 src: url(font-path('Chunkfive-webfont.eot') + '?#iefix') format('embedded-opentype'),
      url(font-path('Chunkfive-webfont.woff')) format('woff'),
      url(font-path('Chunkfive-webfont.ttf')) format('truetype'),
      url(font-path('Chunkfive-webfont.svg') + '#ChunkFiveRegular') format('svg');
 font-weight: normal;
 font-style: normal;
}

Is there a reason for compass to have font-url at all? Is it just for non-rails projects? Would it make sense to suppress these conflicting compass helpers in Rails 3.1+ projects?


Reply to this email directly or view it on GitHub:
#630 (comment)

@agibralter

This comment has been minimized.

Show comment
Hide comment
@agibralter

agibralter Nov 22, 2011

Contributor

So whichever is first takes precedence?

Contributor

agibralter commented Nov 22, 2011

So whichever is first takes precedence?

@scottdavis

This comment has been minimized.

Show comment
Hide comment
@scottdavis

scottdavis Nov 22, 2011

Member

Yes

Sent from my iPhone

On Nov 22, 2011, at 2:43 PM, Aaron Gibralterreply@reply.github.com wrote:

So whichever is first takes precedence?


Reply to this email directly or view it on GitHub:
#630 (comment)

Member

scottdavis commented Nov 22, 2011

Yes

Sent from my iPhone

On Nov 22, 2011, at 2:43 PM, Aaron Gibralterreply@reply.github.com wrote:

So whichever is first takes precedence?


Reply to this email directly or view it on GitHub:
#630 (comment)

@scottdavis

This comment has been minimized.

Show comment
Hide comment
@scottdavis

scottdavis Dec 1, 2011

Member

can you make me a test app that replicates this so i can get to the bottom of this im trying to iron out all of the rails 3.1 issues for a release

Member

scottdavis commented Dec 1, 2011

can you make me a test app that replicates this so i can get to the bottom of this im trying to iron out all of the rails 3.1 issues for a release

@agibralter

This comment has been minimized.

Show comment
Hide comment
@agibralter

agibralter Dec 1, 2011

Contributor

Sure, I've got a deployment I'm working hard to get done, but after I'll try to throw one together. I'll try to do it in the next couple of days.

Contributor

agibralter commented Dec 1, 2011

Sure, I've got a deployment I'm working hard to get done, but after I'll try to throw one together. I'll try to do it in the next couple of days.

@scottdavis

This comment has been minimized.

Show comment
Hide comment
@scottdavis

scottdavis Dec 1, 2011

Member

thanks appreciate it

Member

scottdavis commented Dec 1, 2011

thanks appreciate it

@agibralter

This comment has been minimized.

Show comment
Hide comment
@agibralter

agibralter Dec 6, 2011

Contributor

Ok, this is roughly how I have my app set up. Go ahead and bundle install and run rake assets:precompile. And then check out app/assets/stylesheets/fonts... The first method works (that uses font-path from sass-rails). The second, fails... because it is also using the sass-rails helper, not compass's which takes two arguments.

Contributor

agibralter commented Dec 6, 2011

Ok, this is roughly how I have my app set up. Go ahead and bundle install and run rake assets:precompile. And then check out app/assets/stylesheets/fonts... The first method works (that uses font-path from sass-rails). The second, fails... because it is also using the sass-rails helper, not compass's which takes two arguments.

@agibralter

This comment has been minimized.

Show comment
Hide comment
@agibralter

agibralter Dec 29, 2011

Contributor

Oh whoa, I don't think I ever linked to the repo: https://github.com/agibralter/compass-rails-url-helpers-test

Contributor

agibralter commented Dec 29, 2011

Oh whoa, I don't think I ever linked to the repo: https://github.com/agibralter/compass-rails-url-helpers-test

@chriseppstein

This comment has been minimized.

Show comment
Hide comment
@chriseppstein

chriseppstein Mar 12, 2012

Member

this is fixed by using compass-rails.

Member

chriseppstein commented Mar 12, 2012

this is fixed by using compass-rails.

@ggarnier

This comment has been minimized.

Show comment
Hide comment
@ggarnier

ggarnier Apr 9, 2012

I'm having this issue even using compass-rails. Do I need to make a specific configuration, besides what's described on README?

ggarnier commented Apr 9, 2012

I'm having this issue even using compass-rails. Do I need to make a specific configuration, besides what's described on README?

@chriseppstein

This comment has been minimized.

Show comment
Hide comment
@chriseppstein

chriseppstein Apr 9, 2012

Member

If you follow the readme you should be good to go. The helpers do not conflict anymore -- compass defers to any existing impl of those functions.

Member

chriseppstein commented Apr 9, 2012

If you follow the readme you should be good to go. The helpers do not conflict anymore -- compass defers to any existing impl of those functions.

@ggarnier

This comment has been minimized.

Show comment
Hide comment
@ggarnier

ggarnier Apr 10, 2012

But shouldn't asset-url function accept only one parameter? When I try this:

asset-url("image.jpg")

I get this error:

wrong number of arguments (1 for 2) for `asset-url'

It only works if I pass a second parameter:

asset-url("image.jpg", images)

ggarnier commented Apr 10, 2012

But shouldn't asset-url function accept only one parameter? When I try this:

asset-url("image.jpg")

I get this error:

wrong number of arguments (1 for 2) for `asset-url'

It only works if I pass a second parameter:

asset-url("image.jpg", images)
@chriseppstein

This comment has been minimized.

Show comment
Hide comment
@chriseppstein

chriseppstein Apr 10, 2012

Member

Compass doesn't define an asset-url() function. That is provided by sass-rails.

Member

chriseppstein commented Apr 10, 2012

Compass doesn't define an asset-url() function. That is provided by sass-rails.

@ggarnier

This comment has been minimized.

Show comment
Hide comment
@ggarnier

ggarnier Apr 10, 2012

Sorry, I made a little confusion with asset_url rails helper.

ggarnier commented Apr 10, 2012

Sorry, I made a little confusion with asset_url rails helper.

@chriseppstein

This comment has been minimized.

Show comment
Hide comment
@chriseppstein

chriseppstein Apr 10, 2012

Member

It's a wrapper over public_path if you think there should be a different behavior, please let me know on the sass-rails issue tracker.

Member

chriseppstein commented Apr 10, 2012

It's a wrapper over public_path if you think there should be a different behavior, please let me know on the sass-rails issue tracker.

@christianvuerings

This comment has been minimized.

Show comment
Hide comment
@christianvuerings

christianvuerings Nov 22, 2012

@ggarnier @chriseppstein it looks like you can use image-url( instead of asset-url(. That way you don't need the 2 arguments.

christianvuerings commented Nov 22, 2012

@ggarnier @chriseppstein it looks like you can use image-url( instead of asset-url(. That way you don't need the 2 arguments.

@aminhotob

This comment has been minimized.

Show comment
Hide comment
@aminhotob

aminhotob Apr 8, 2013

I have the same error with

@include font-face("this name", font-files("this.woff", woff, "this.otf", opentype), "this.eot"); ArgumentError: wrong number of arguments (2 for 1) (in ****_/index.css.scss) from /Users/_/.rvm/gems/ruby-2.0.0-p0@global/gems/sprockets-2.9.0/lib/sprockets/context.rb:260:in `font_path'

and background-image: image-url('icons/facebook.png'); ArgumentError: wrong number of arguments (2 for 1) (in ****_/index.css.scss) from /Users/_/.rvm/gems/ruby-2.0.0-p0@global/gems/sprockets-2.9.0/lib/sprockets/context.rb:245:in `image_path'

aminhotob commented Apr 8, 2013

I have the same error with

@include font-face("this name", font-files("this.woff", woff, "this.otf", opentype), "this.eot"); ArgumentError: wrong number of arguments (2 for 1) (in ****_/index.css.scss) from /Users/_/.rvm/gems/ruby-2.0.0-p0@global/gems/sprockets-2.9.0/lib/sprockets/context.rb:260:in `font_path'

and background-image: image-url('icons/facebook.png'); ArgumentError: wrong number of arguments (2 for 1) (in ****_/index.css.scss) from /Users/_/.rvm/gems/ruby-2.0.0-p0@global/gems/sprockets-2.9.0/lib/sprockets/context.rb:245:in `image_path'

@endash

This comment has been minimized.

Show comment
Hide comment
@endash

endash Oct 19, 2013

For googles in a similar situation to me:
compass deferring to sass-rails is a problem if you don't use sprockets. If you use rake-pipeline, the sass-rails implementations will barf all over everything. The solution is not pretty :( I got everything to play nicely together, at least for assets:precompile, by (1) excising the default rake-pipeline rake task via forking and removing it from the repo (2) putting sass-rails and compass-rails in separate groups and (3) writing my own assets:precompile task that spawns rake with a second compilation task, scoped only to that group. No luck with development/on demand asset generation, yet.

endash commented Oct 19, 2013

For googles in a similar situation to me:
compass deferring to sass-rails is a problem if you don't use sprockets. If you use rake-pipeline, the sass-rails implementations will barf all over everything. The solution is not pretty :( I got everything to play nicely together, at least for assets:precompile, by (1) excising the default rake-pipeline rake task via forking and removing it from the repo (2) putting sass-rails and compass-rails in separate groups and (3) writing my own assets:precompile task that spawns rake with a second compilation task, scoped only to that group. No luck with development/on demand asset generation, yet.

@brianjlandau

This comment has been minimized.

Show comment
Hide comment
@brianjlandau

brianjlandau Dec 16, 2014

Working with:

  • Rails 4.1.8
  • sprockets-rails 2.2.2
  • compass-rails 1.1.7
  • compass 0.12.7
  • sass 3.2.19
  • sass-rails 4.0.4
  • sprockets 2.11.0

and this is still an issue.

If I try updating to:

  • compass-rails 2.0.1
  • compass 1.0.1
  • sass-rails 5.0.0
  • sass 3.4.9
  • sprockets 2.11.0 (or 2.12.3)

I get a ArgumentError: wrong number of arguments (2 for 1) exception from an @import statement in a SASS/SCSS file when trying to precompile the assets on deploy.

Anybody have any solutions?

brianjlandau commented Dec 16, 2014

Working with:

  • Rails 4.1.8
  • sprockets-rails 2.2.2
  • compass-rails 1.1.7
  • compass 0.12.7
  • sass 3.2.19
  • sass-rails 4.0.4
  • sprockets 2.11.0

and this is still an issue.

If I try updating to:

  • compass-rails 2.0.1
  • compass 1.0.1
  • sass-rails 5.0.0
  • sass 3.4.9
  • sprockets 2.11.0 (or 2.12.3)

I get a ArgumentError: wrong number of arguments (2 for 1) exception from an @import statement in a SASS/SCSS file when trying to precompile the assets on deploy.

Anybody have any solutions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment