ArgumentError参数个数错误(给定0,预期1) - Scss文件

时间:2017-03-21 20:30:36

标签: ruby-on-rails sass

我正在运行Rails(v4.2.6)应用程序。当我尝试使用HTTPWebResponse response = (HttpWebRequest)request.GetResponse(); 时,应用程序在使用Sass功能时崩溃(即:使用变量)。

它给出的确切错误:

.scss

在线

wrong number of arguments (given 0, expected 1) (in .../app/assets/stylesheets/application.scss)

代码导致崩溃 = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true (使用变量)

application.scss

的Gemfile

    $color: #FFF;
    a {
      color: $color;
    }

Gemfile.lock的

    # encoding: UTF-8
    source 'https://rubygems.org'

    # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
    gem 'rails'

    # Use mysql as the production database
    gem 'mysql2'

    # authentication gems
    gem 'devise'
    gem 'doorkeeper'

    # logging
    gem 'impressionist'

    # RestClient for sending mail using mailgun
    gem 'rest-client'

    # new search engine
    gem 'fuzzily'

    # Use SCSS for stylesheets, sprockets for assets
    gem 'sprockets', '~> 2.11.0'
    gem 'sass-rails'

    # use of Haml and rabl
    gem 'haml'
    gem 'rabl'

    # Gem voor html5 stubs met form features
    gem 'modernizr-rails'

    # Use for javascript and libraries
    gem 'execjs'
    gem 'jquery-rails'

    # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
    gem 'turbolinks'
    gem 'responders'

    # settings cached in rails environment
    gem 'rails-settings-cached'

    # Paperclip easy file upload to S3
    gem 'paperclip'

    # fancy JS alert and confirm
    gem 'sweetalert-rails'

    # Clipboard: Saved text to clipboard
    gem 'clipboard-rails'

    group :production do
      gem 'unicorn'
      gem 'aws-sdk', '~> 1.5.7'
      gem 'uglifier'
    end

    group :development do
      gem 'web-console'
      gem 'spring'
      gem 'faker'
    end

    group :test do
      gem 'spring'
      gem 'faker'
    end

备注
我已经看到在使用sass-rails时不建议使用 GEM remote: https://rubygems.org/ specs: actionmailer (4.2.6) actionpack (= 4.2.6) actionview (= 4.2.6) activejob (= 4.2.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) actionpack (4.2.6) actionview (= 4.2.6) activesupport (= 4.2.6) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) actionview (4.2.6) activesupport (= 4.2.6) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) activejob (4.2.6) activesupport (= 4.2.6) globalid (>= 0.3.0) activemodel (4.2.6) activesupport (= 4.2.6) builder (~> 3.1) activerecord (4.2.6) activemodel (= 4.2.6) activesupport (= 4.2.6) arel (~> 6.0) activesupport (4.2.6) i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) arel (6.0.3) aws-sdk (1.5.8) httparty (~> 0.7) json (~> 1.4) nokogiri (>= 1.4.4) uuidtools (~> 2.1) bcrypt (3.1.11) builder (3.2.2) climate_control (0.0.3) activesupport (>= 3.0) clipboard-rails (1.6.0) cocaine (0.5.8) climate_control (>= 0.0.3, < 1.0) coffee-rails (4.1.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.1.x) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.10.0) debug_inspector (0.0.2) devise (3.5.6) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 3.2.6, < 5) responders thread_safe (~> 0.1) warden (~> 1.2.3) domain_name (0.5.20160310) unf (>= 0.0.5, < 1.0.0) doorkeeper (3.1.0) railties (>= 3.2) erubis (2.7.0) execjs (2.6.0) faker (1.6.3) i18n (~> 0.5) fuzzily (0.3.3) activerecord (>= 2.3.17) globalid (0.3.6) activesupport (>= 4.1.0) haml (4.0.7) tilt hike (1.2.3) http-cookie (1.0.2) domain_name (~> 0.5) httparty (0.13.7) json (~> 1.8) multi_xml (>= 0.5.2) httpclient (2.7.1) i18n (0.7.0) impressionist (1.5.1) httpclient (~> 2.2) nokogiri (~> 1.5) jquery-rails (4.1.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (1.8.3) kgio (2.10.0) loofah (2.0.3) nokogiri (>= 1.5.9) mail (2.6.4) mime-types (>= 1.16, < 4) mime-types (2.99.1) mimemagic (0.3.0) mini_portile2 (2.0.0) minitest (5.8.4) modernizr-rails (2.7.1) multi_json (1.11.2) multi_xml (0.5.5) mysql2 (0.4.3) netrc (0.11.0) nokogiri (1.6.7.2) mini_portile2 (~> 2.0.0.rc2) orm_adapter (0.5.0) paperclip (4.3.6) activemodel (>= 3.2.0) activesupport (>= 3.2.0) cocaine (~> 0.5.5) mime-types mimemagic (= 0.3.0) rabl (0.12.0) activesupport (>= 2.3.14) rack (1.6.4) rack-test (0.6.3) rack (>= 1.0) rails (4.2.6) actionmailer (= 4.2.6) actionpack (= 4.2.6) actionview (= 4.2.6) activejob (= 4.2.6) activemodel (= 4.2.6) activerecord (= 4.2.6) activesupport (= 4.2.6) bundler (>= 1.3.0, < 2.0) railties (= 4.2.6) sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) rails-dom-testing (1.0.7) activesupport (>= 4.2.0.beta, < 5.0) nokogiri (~> 1.6.0) rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.3) loofah (~> 2.0) rails-settings-cached (0.5.4) rails (>= 4.2.0) railties (4.2.6) actionpack (= 4.2.6) activesupport (= 4.2.6) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) raindrops (0.16.0) rake (11.1.2) responders (2.1.2) railties (>= 4.2.0, < 5.1) rest-client (1.8.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 3.0) netrc (~> 0.7) sass (3.4.21) sass-rails (5.0.4) railties (>= 4.0.0, < 5.0) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) spring (1.6.4) sprockets (2.11.3) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) sprockets-rails (2.3.3) actionpack (>= 3.0) activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) sweetalert-rails (1.1.3) railties (>= 3.1.0) thor (0.19.1) thread_safe (0.3.5) tilt (1.4.1) turbolinks (2.5.3) coffee-rails tzinfo (1.2.2) thread_safe (~> 0.1) uglifier (3.0.0) execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext unf_ext (0.0.7.2) unicorn (5.0.1) kgio (~> 2.6) rack raindrops (~> 0.7) uuidtools (2.1.5) warden (1.2.6) rack (>= 1.0) web-console (3.1.1) activemodel (>= 4.2) debug_inspector railties (>= 4.2) PLATFORMS ruby DEPENDENCIES aws-sdk (~> 1.5.7) clipboard-rails devise doorkeeper execjs faker fuzzily haml impressionist jquery-rails modernizr-rails mysql2 paperclip rabl rails rails-settings-cached responders rest-client sass-rails spring sprockets (~> 2.11.0) sweetalert-rails turbolinks uglifier unicorn web-console BUNDLED WITH 1.13.6 语句,但删除这些语句没有用
使用require输出有效的sass application.scss application.css文件

编辑(22/03/17): 固定代码中的空格

1 个答案:

答案 0 :(得分:0)

删除冒号之前的空格,如下所示:

$color: #FFF;
a {
  color: $color;
}