Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which gem is breaking Rails application.css.scss wrong number of arguments 3 for 2

Okay. This is a new problem caused by a gem update. Calling bundle update breaks my rails application. Here are the gems that changed:

# Gemfile.lock
-    compass (0.12.7)
+    compass (0.12.2)
-      sass (~> 3.2.19)
+      sass (~> 3.1)
-    country_select (2.0.1) # Not likely this
+    country_select (2.1.0) # Not likely this
-    devise (3.3.0)
+    devise (3.4.0)
+      responders
-    excon (0.39.6)
-    execjs (2.2.1)
+    excon (0.40.0)
+    execjs (2.2.2)
-    jbuilder (2.1.3)
+    jbuilder (2.2.2)
-    jquery-ui-rails (5.0.0)
+    jquery-ui-rails (5.0.1)
-    mime-types (2.3)
+    mime-types (2.4.2)
-    netrc (0.7.7)
+    netrc (0.8.0)
-    omniauth-twitter (1.0.1) # Not likely this
+    omniauth-twitter (1.1.0) # Not likely this
-    railroady (1.1.2)  # Not likely this
+    railroady (1.2.0) # Not likely this
-    rails_12factor (0.0.2)
+    rails_12factor (0.0.3)
-    rails_layout (1.0.22)
+    rails_layout (1.0.23)
-    sass (3.2.19)
+    sass (3.2.0)
-    sprockets-rails (2.1.4)
+    sprockets-rails (2.2.0)
-      sprockets (~> 2.8)
+      sprockets (>= 2.8, < 4.0)
-    turbolinks (2.3.0)
+    turbolinks (2.4.0)
-    twilio-ruby (3.13.0) # Not likely this
+    twilio-ruby (3.13.1) # Not likely this

The error I get is:

wrong number of arguments (3 for 2)
(in /app/assets/stylesheets/application.css.scss)

And better errors shows it happening at this line:

<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>

If you can tell me which gem is responsible for the error I can version out the new one in my Gemfile. It does the same thing on my local machine and Heroku. I'm maintaining the older Gemfile.lock for now.


For the record I tried installing each gem individually. Afterwards I had no problem on the local machine, but Heroku failed with the same error and would not build.


Following Paul Richter's tip it's either compass, sprockets, or sass

sass-rails (4.0.3) lib/sass/rails/importer.rb:80:in `engine_from_path'
sass-rails (4.0.3) lib/sass/rails/importer.rb:27:in `find_relative'
sass (3.2.0) lib/sass/tree/import_node.rb:45:in `import'
sass (3.2.0) lib/sass/tree/import_node.rb:25:in `imported_file'
sass (3.2.0) lib/sass/tree/import_node.rb:34:in `css_import?'
sass (3.2.0) lib/sass/tree/visitors/perform.rb:214:in `visit_import'
sass (3.2.0) lib/sass/tree/visitors/base.rb:37:in `visit'
sass (3.2.0) lib/sass/tree/visitors/perform.rb:97:in `visit'
sass (3.2.0) lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
sass (3.2.0) lib/sass/tree/visitors/base.rb:53:in `visit_children'
sass (3.2.0) lib/sass/tree/visitors/perform.rb:106:in `block in visit_children'
sass (3.2.0) lib/sass/tree/visitors/perform.rb:118:in `with_environment'
sass (3.2.0) lib/sass/tree/visitors/perform.rb:105:in `visit_children'
sass (3.2.0) lib/sass/tree/visitors/base.rb:37:in `block in visit'
sass (3.2.0) lib/sass/tree/visitors/perform.rb:125:in `visit_root'
sass (3.2.0) lib/sass/tree/visitors/base.rb:37:in `visit'
sass (3.2.0) lib/sass/tree/visitors/perform.rb:97:in `visit'
sass (3.2.0) lib/sass/tree/visitors/perform.rb:7:in `visit'
sass (3.2.0) lib/sass/tree/root_node.rb:20:in `render'
sass (3.2.0) lib/sass/engine.rb:315:in `_render'
sass (3.2.0) lib/sass/engine.rb:262:in `render'
compass-rails (2.0.0) lib/compass-rails/patches/sass_importer.rb:29:in `evaluate'
tilt (1.4.1) lib/tilt/template.rb:103:in `render'
sprockets (2.11.0) lib/sprockets/context.rb:197:in `block in evaluate'
sprockets (2.11.0) lib/sprockets/context.rb:194:in `evaluate'
sprockets (2.11.0) lib/sprockets/processed_asset.rb:12:in `initialize'
sprockets (2.11.0) lib/sprockets/base.rb:374:in `block in build_asset'
sprockets (2.11.0) lib/sprockets/base.rb:395:in `circular_call_protection'
sprockets (2.11.0) lib/sprockets/base.rb:373:in `build_asset'
sprockets (2.11.0) lib/sprockets/index.rb:94:in `block in build_asset'
sprockets (2.11.0) lib/sprockets/caching.rb:58:in `cache_asset'
sprockets (2.11.0) lib/sprockets/index.rb:93:in `build_asset'
sprockets (2.11.0) lib/sprockets/base.rb:287:in `find_asset'
sprockets (2.11.0) lib/sprockets/index.rb:61:in `find_asset'
sprockets (2.11.0) lib/sprockets/bundled_asset.rb:16:in `initialize'
sprockets (2.11.0) lib/sprockets/base.rb:377:in `build_asset'
sprockets (2.11.0) lib/sprockets/index.rb:94:in `block in build_asset'
sprockets (2.11.0) lib/sprockets/caching.rb:58:in `cache_asset'
sprockets (2.11.0) lib/sprockets/index.rb:93:in `build_asset'
sprockets (2.11.0) lib/sprockets/base.rb:287:in `find_asset'
sprockets (2.11.0) lib/sprockets/index.rb:61:in `find_asset'
sprockets (2.11.0) lib/sprockets/environment.rb:75:in `find_asset'
sprockets (2.11.0) lib/sprockets/base.rb:295:in `[]'
sprockets-rails (2.2.0) lib/sprockets/rails/helper.rb:230:in `lookup_asset_for_path'
sprockets-rails (2.2.0) lib/sprockets/rails/helper.rb:190:in `check_errors_for'
sprockets-rails (2.2.0) lib/sprockets/rails/helper.rb:159:in `block in stylesheet_link_tag'
sprockets-rails (2.2.0) lib/sprockets/rails/helper.rb:158:in `stylesheet_link_tag'
like image 447
6ft Dan Avatar asked Oct 17 '14 00:10

6ft Dan


1 Answers

The problem is with sass. Here's a link to the the official issue.

Locking sass-rails to version 4.0.3 has worked for me on rails-4.0.x through rails-4.1.x. In your Gemfile:

gem 'sass-rails', '4.0.3'

UPDATE

A better solution I have found is to use the 4-0-stable branch:

gem 'sass-rails', github: 'rails/sass-rails', branch: '4-0-stable'
like image 165
infused Avatar answered Nov 15 '22 20:11

infused