手順
状態:試行錯誤中
閲覧数:2,597
投稿日:2015-12-23
更新日:2015-12-23
0.Rubyインストール確認
1.Rubyインストール
2.Sass インストール
Ruby 2.2.3 (x64)
・rubyinstaller-2.2.3-x64.exe
インストール先
▼D:\Ruby22-x64
Rubyインストール確認
・コマンドプロンプト再起動
1.Rubyインストール
2.Sass インストール
0.Rubyインストール確認
ruby -v
'ruby' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
1.Rubyインストール
Ruby 2.2.3 (x64)
・rubyinstaller-2.2.3-x64.exe
インストール先
▼D:\Ruby22-x64
Rubyインストール確認
・コマンドプロンプト再起動
ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x64-mingw32]
2.Sass インストール
2-1.UTF-8 指定
Windows OS は文字コードが Shift_JIS なので、予め UTF-8 指定
set LANG=ja_JP.UTF-8
2-2.RubyGems を更新
gem update --system
Updating rubygems-update
Fetching: rubygems-update-2.5.1.gem (100%)
Successfully installed rubygems-update-2.5.1
Parsing documentation for rubygems-update-2.5.1
Installing ri documentation for rubygems-update-2.5.1
Installing darkfish documentation for rubygems-update-2.5.1
Done installing documentation for rubygems-update after 1 seconds
Parsing documentation for rubygems-update-2.5.1
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 2.5.1
RubyGems 2.5.1 installed
Parsing documentation for rubygems-2.5.1
Installing ri documentation for rubygems-2.5.1
=== 2.5.1 / 2015-12-10
Bug fixes:
* Ensure platform sorting only uses strings. Affected binary installs on Windows.
Issue #1369 reported by Ryan Atball (among others).
Pull request #1375 by Samuel E. Giddins.
* Revert PR #1332. Unable to reproduce, and nil should be impossible.
* Gem::Specification#to_fullpath now returns .rb extensions when such a file
exists. Pull request #1114 by y-yagi.
* RubyGems now handles Net::HTTPFatalError instead of crashing. Pull
request #1314 by Samuel E. Giddins.
* Updated bundled Molinillo to 0.4.0. Pull request #1322, #1396 by Samuel E.
Giddins.
* Improved performance of spec loading by reducing likelihood of loading he
complete specification. Pull request #1373 by Aaron Patterson.
* Improved caching of requirable files Pull request #1377 by Aaron Patterson.
* Fixed activation of gems with development dependencies. Pull request #1388
by Samuel E. Giddins.
* RubyGems now uses the same Molinillo vendoring strategy as Bundler. Pull
request #1397 by Samuel E. Giddins.
* Fixed documentation of Gem::Requirement.parse. Pull request #1398 by
Juanito Fatas.
* RubyGems no longer warns when a prerelease gem has prerelease dependencies.
Pull request #1399 by Samuel E. Giddins.
* Fixed Gem::Version documentation example. Pull request #1401 by Guilherme
Goettems Schneider.
* Updated documentation links to https://. Pull request #1404 by Suriyaa
Kudo.
* Fixed double word typo. Pull request #1411 by Jake Worth.
=== 2.5.0 / 2015-11-03
Major enhancements:
* Added the Gem::Licenses class which provides a set of standard license
identifiers as set by spdx.org. This is now used by the
Gem::Specification#license attribute to try to standardize (though not
enforce) licenses set by gem authors.
Pull request #1249 by Kyle Mitchell.
Minor enhancements:
* Use Molinillo as the resolver library. This is the same resolver as used by
Bundler. Pull request #1189 by Samuel E. Giddins.
* Add `--skip=gem_name` to Pristine command. Pull request #1018 by windwiny.
* The parsed gem dependencies file is now available via Gem.gemdeps following
Gem.use_gemdeps. Pull request #1224 by Hsing-Hui Hsu, issue #1213 by
Michal Papis.
* Moved description attribute to recommended for Gem::Specification.
Pull request #1046 by Michal Papis
* Moved `Gem::Indexer#abbreviate` and `#sanitize` to `Gem::Specification`.
Pull request #1145 by Arthur Nogueira Neves
* Cache Gem::Version segments for `#bump` and `#release`.
Pull request #1131 by Matijs van Zuijlen
* Fix edge case in `levenshtein_distance` for comparing longer strings.
Pull request #1173 by Richard Schneeman
* Remove duplication from List#to_a, improving from O(n^2) to O(n) time.
Pull request #1200 by Marc Siegel.
* Gem::Specification.add_specs is deprecated and will be removed from version
3.0 with no replacement. To add specs, install the gem, then reset the
cache.
* Gem::Specification.add_spec is deprecated and will be removed from version
3.0 with no replacement. To add specs, install the gem, then reset the
cache.
* Gem::Specification.remove_spec is deprecated and will be removed from version
3.0 with no replacement. To remove specs, uninstall the gem, then reset the
cache by calling Gem::Specification.reset.
* Call Array#compact before calling Array#uniq for minor speed improvement in
the Gem::Specification#files method.
Pull request #1253 by Marat Amerov.
* Use stringio instead of custom String classes.
Pull request #1250 by Petr Skocik.
* Use URI#host instead of URI#hostname to retain backwards compatibility with
Ruby 1.9.2 and earlier in util library.
Pull request #1288 by Joe Rafaniello.
* Documentation update for gem sources.
Pull request #1324 by Ilya Vassilevsky.
* Documentation update for required_ruby_version.
Pull request #1321 by Matt Patterson.
* Documentation update for gem update.
Pull request #1306 by Tim Blair.
* Emit a warning on SRV resolve failure.
Pull request #1023 by Ivan Kuchin.
* Allow duplicate dependencies between runtime and development.
Pull request #1032 by Murray Steele.
* The gem env command now shows the user installation directory.
Pull request #1343 by Luis Sagastume.
* The Gem::Platform#=== method now treats a nil cpu arch the same as 'universal'.
Pull request #1356 by Daniel Berger.
* Improved memory performance in Gem::Specification.traverse. Pull request
#1188 by Aaron Patterson.
* RubyGems packages now support symlinks. Pull request #1209 by Samuel E.
Giddins.
* RubyGems no longer outputs mkmf.log if it does not exist. Pull request
#1222 by Andrew Hooker.
* Added Bitrig platform. Pull request #1233 by John C. Vernaleo.
* Improved error message for first-time RubyGems developers. Pull request
#1241 by André Arko
* Improved performance of Gem::Specification#load with cached specs. Pull
request #1297 by Samuel E. Giddins.
* Gem::RemoteFetcher allows users to set HTTP headers. Pull request #1363 by
Agis Anastasopoulos.
Bug fixes:
* Fixed Rake homepage url in example for Gem::Specification#homepage.
Pull request #1171 by Arthur Nogueira Neves
* Don't crash if partially uninstalled gem can't be found.
Pull request #1283 by Cezary Baginski.
* Test warning cleanup.
Pull request #1298 by Samuel E. Giddins.
* Documentation fix for GemDependencyAPI.
Pull request #1308 by Michael Papis.
* Fetcher now ignores ENOLCK errors in single threaded environments. This
handles an issue with gem installation on NFS as best we can. Addresses
issue #1176 by Ryan Moore.
Pull request #1327 by Daniel Berger.
* Fix some path quoting issues in the test suite.
Pull request #1328 by Gavin Miller.
* Fix NoMethodError in running ruby processes when gems are uninstalled.
Pull request #1332 by Peter Drake.
* Fixed a potential NoMethodError for gem cleanup.
Pull request #1333 by Peter Drake.
* Fixed gem help bug.
Issue #1352 reported by bogem, pull request #1357 by Luis Sagastume.
* Remove temporary directories after tests finish. Pull request #1181 by
Nobuyoshi Nokada.
* Update links in RubyGems documentation. Pull request #1185 by Darío Hereñú.
* Prerelease gem executables can now be run. Pull request #1186 by Samuel E.
Giddins.
* Updated RubyGems travis-ci ruby versions. Pull request #1187 by Samuel E.
Giddins.
* Fixed release date of RubyGems 2.4.6. Pull request #1190 by Frieder
Bluemle.
* Fixed bugs in gem activation. Pull request #1202 by Miklós Fazekas.
* Fixed documentation for `gem list`. Pull request #1228 by Godfrey Chan.
* Fixed #1200 history entry. Pull request #1234 by Marc Siegel.
* Fixed synchronization issue when resetting the Gem::Specification gem list.
Pull request #1239 by Samuel E. Giddins.
* Fixed running tests in parallel. Pull request #1257 by SHIBATA Hiroshi.
* Fixed running tests with `--program-prefix` or `--program-suffix` for ruby.
Pull request #1258 by Shane Gibbs.
* Fixed Gem::Specification#to_yaml. Pull request #1262 by Hiroaki Izu.
* Fixed taintedness of Gem::Specification#raw_require_paths. Pull request
#1268 by Sam Ruby.
* Fixed sorting of platforms when installing gems. Pull request #1271 by
nonsequitur.
* Use `--no-document` over deprecated documentation options when installing
dependencies on travis. Pull request #1272 by takiy33.
* Improved support for IPv6 addresses in URIs. Pull request #1275 by Joe
Rafaniello.
* Spec validation no longer crashes if a file does not exist. Pull request
#1278 by Samuel E. Giddins.
* Gems can now be installed within `rescue`. Pull request #1282 by Samuel E.
Giddins.
* Increased Diffie-Hellman key size for tests for modern OpenSSL. Pull
request #1290 by Vít Ondruch.
* RubyGems handles invalid config files better. Pull request #1367 by Agis
Anastasopoulos.
=== 2.4.8 / 2015-06-08
Bug fixes:
* Tightened API endpoint checks for CVE-2015-3900
=== 2.4.7 / 2015-05-14
Bug fixes:
* Limit API endpoint to original security domain for CVE-2015-3900.
Fix by claudijd
=== 2.4.6 / 2015-02-05
Bug fixes:
* Fixed resolving gems with both upper and lower requirement boundaries.
Issue #1141 by Jakub Jirutka.
* Moved extension directory after require_paths to fix missing constant bugs
in some gems with C extensions. Issue #784 by André Arko, pull request
#1137 by Barry Allard.
* Use Gem::Dependency#requirement when adding a dependency to an existing
dependency instance. Pull request #1101 by Josh Cheek.
* Fixed warning of shadowed local variable in Gem::Specification. Pull request
#1109 by Rohit Arondekar
* Gem::Requirement should always sort requirements before coercion to Hash.
Pull request #1139 by Eito Katagiri.
* The `gem open` command should change the current working directory before
opening the editor. Pull request #1142 by Alex Wood.
* Ensure quotes are stripped from the Windows launcher script used to install
gems. Pull request #1115 by Youngjun Song.
* Fixed errors when writing to NFS to to 0444 files. Issue #1161 by Emmanuel
Hadoux.
* Removed dead code in Gem::StreamUI. Pull request #1117 by mediaslave24.
* Fixed typos. Pull request #1096 by hakeda.
* Relaxed CMake dependency for RHEL 6 and CentOS 6. Pull request #1124 by Vít
Ondruch.
* Relaxed Psych dependency. Pull request #1128 by Vít Ondruch.
------------------------------------------------------------------------------
RubyGems installed the following executables:
D:/Ruby22-x64/bin/gem
Ruby Interactive (ri) documentation was installed. ri is kind of like man
pages for ruby libraries. You may access it like this:
ri Classname
ri Classname.class_method
ri Classname#instance_method
If you do not wish to install this documentation in the future, use the
--no-document flag, or set it as the default in your ~/.gemrc file. See
'gem help env' for details.
RubyGems system software updated
2-3.Sass インストール
RubyGems 経由で Sass をインストール
gem install sass
Fetching: sass-3.4.20.gem (100%)
Successfully installed sass-3.4.20
Parsing documentation for sass-3.4.20
Installing ri documentation for sass-3.4.20
Done installing documentation for sass after 5 seconds
1 gem installed
コンパイル
dir
ドライブ D のボリューム ラベルは Data です
ボリューム シリアル番号は A456-3DAB です
D:\0-scss\scss のディレクトリ
2015/12/23 18:12 <DIR> .
2015/12/23 18:12 <DIR> ..
2015/12/18 22:33 8,099 .csscomb.json
2015/12/23 18:12 <DIR> bootstrap
2015/12/18 22:33 39,830 landio.scss
2015/12/23 18:12 <DIR> plugins
2015/12/18 22:33 1,892 _icomoon.scss
3 個のファイル 49,821 バイト
4 個のディレクトリ 407,575,441,408 バイトの空き領域
D:\0-scss\scss>
sass --style expanded landio.scss:new3.css
失敗履歴
D:\0-scss\scss>
D:\0-scss\scss>
▼new.css
対応
▼landio.scss
・Error: Import directives may not be used within control directives or mixins.on line ★★ of hoge.scss
sass --style expanded style.scss:style.css
Errno::ENOENT: No such file or directory @ rb_sysopen - style.scss
Use --trace for backtrace.
D:\0-scss\scss>
sass --style expanded landio.scss:new.css
Error: Import directives may not be used within control directives or mixins.
on line 95 of landio.scss
Use --trace for backtrace.
▼new.css
/*
Error: Import directives may not be used within control directives or mixins.
on line 95 of landio.scss
90: // Video JS
91: @import 'plugins/videojs-landio-skin';
92:
93: // Animate CSS (none for mobile)
94: @include media-breakpoint-up(md) {
95: @import 'plugins/animate';
96: }
97:
98:
99: //
100: // =Waypoint animations
Backtrace:
landio.scss:95
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/check_nesting.rb:13:in `visit'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/base.rb:52:in `map'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/base.rb:52:in `visit_children'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/check_nesting.rb:49:in `visit_children'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/base.rb:38:in `visit'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/check_nesting.rb:15:in `visit'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/base.rb:52:in `map'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/base.rb:52:in `visit_children'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/check_nesting.rb:49:in `visit_children'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/base.rb:36:in `block in visit'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/check_nesting.rb:57:in `visit_root'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/base.rb:36:in `visit'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/check_nesting.rb:15:in `visit'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/visitors/base.rb:24:in `visit'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/root_node.rb:35:in `css_tree'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/tree/root_node.rb:29:in `render_with_sourcemap'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/engine.rb:378:in `_render_with_sourcemap'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/engine.rb:295:in `render_with_sourcemap'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/exec/sass_scss.rb:412:in `run'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/exec/sass_scss.rb:63:in `process_result'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/exec/base.rb:52:in `parse'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/lib/sass/exec/base.rb:19:in `parse!'
D:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.20/bin/sass:13:in `<top (required)>'
D:/Ruby22-x64/bin/sass:23:in `load'
D:/Ruby22-x64/bin/sass:23:in `<main>'
*/
body:before {
white-space: pre;
font-family: monospace;
content: "Error: Import directives may not be used within control directives or mixins.\A on line 95 of landio.scss\A \A 90: // Video JS\A 91: @import 'plugins/videojs-landio-skin';\A 92: \A 93: // Animate CSS (none for mobile)\A 94: @include media-breakpoint-up(md) {\A 95: @import 'plugins/animate';\A 96: }\A 97: \A 98: \A 99: //\A 100: // =Waypoint animations"; }
対応
▼landio.scss
// Animate CSS (none for mobile)
@include media-breakpoint-up(md) {
// @import 'plugins/animate';
}
・Error: Import directives may not be used within control directives or mixins.on line ★★ of hoge.scss
質問したけれども回答を得られなかったQ1
質問したけれども回答を得られなかったQ2
sass --style expanded hoge.scss:foo.css
Error: Import directives may not be used within control directives or mixins.on line ★★ of hoge.scss
▼hoge.scss
@include media-breakpoint-up(md) {
@import 'lib/move';
}
When I comment out as the below code, CSS file is generated without error. However, it would be different from the CSS content that I intended to because it is commented out
▼hoge.scss
@include media-breakpoint-up(md) {
//@import 'lib/move';
}
When I change the code like below, CSS file is generated without error. However, it would be different from the CSS content that I intended to.
▼hoge.scss
@import 'lib/move';
@include media-breakpoint-up(md) {}
environment
・Windows
sass -v
Sass 3.4.20 (Selective Steve)
関連リンク
Link1
You can not use import into include mixin. This is your error. You have to move the import line outside conditionals or directives.
・Error when importing files within breakpoint-sass mixinLink2
▼_partial.scss
@mixin partial {
// 既存CSS
}
▼styles.scss
@import '_partial.scssまでのパス';
@include media-breakpoint-up(md) {
@include partial;
}
・@import in @if statement in SASS
・とほほのSass入門
・Allow optional @imports · Issue #779 · sass/sass · GitHub
・Sass(SCSS)入門
D:\0-scss\scss>sass --new scss:.
OptionParser::InvalidOption: invalid option: --new
Use --trace for backtrace.
D:\0-scss\scss>sass --style expanded style.scss:style.css
Errno::ENOENT: No such file or directory @ rb_sysopen - style.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style expanded landio.scss:new.css
Error: Import directives may not be used within control directives or mixins.
on line 95 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style expanded landio.scss:new1.css
Error: Import directives may not be used within control directives or mixins.
on line 95 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style expanded landio.scss:new2.css
Error: Import directives may not be used within control directives or mixins.
on line 95 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style expanded landio.scss:new3.css
D:\0-scss\scss>sass --style expanded landio.scss:new4.css
D:\0-scss\scss>sass --style expanded landio.scss:new5.css
Error: ".video-js" failed to @extend ".has-light-mask".
The selector ".has-light-mask" was not found.
Use "@extend .has-light-mask !optional" if the extend should be able to fail.
on line 350 of plugins/_videojs-landio-skin.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style expanded landio.scss:new6.css
D:\0-scss\scss>sass --style expanded landio.scss:new7.css
D:\0-scss\scss>sass --style expanded landio.scss:new8.css
D:\0-scss\scss>sass --style expanded landio.scss:new9.css
Error: Import directives may not be used within control directives or mixins.
on line 95 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style expanded landio.scss:new9.css
D:\0-scss\scss>../
'..' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
D:\0-scss\scss>cd ../
D:\0-scss>cd scss
D:\0-scss\scss>sass --style expanded landio.scss:new10.css
Error: Import directives may not be used within control directives or mixins.
on line 95 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style expanded landio.scss:new10.css
Error: Import directives may not be used within control directives or mixins.
on line 95 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style nested landio.scss:new10.css
Error: Import directives may not be used within control directives or mixins.
on line 95 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style nested landio.scss:new11.css
Error: Import directives may not be used within control directives or mixins.
on line 95 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style nested landio.scss:new12.css
Error: Import directives may not be used within control directives or mixins.
on line 95 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style nested landio.scss:new13.css
Error: Import directives may not be used within control directives or mixins.
on line 100 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style nested landio.scss:new14.css
Error: Import directives may not be used within control directives or mixins.
on line 95 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style watch landio.scss:new15.css
Error: Import directives may not be used within control directives or mixins.
on line 95 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style expanded landio.scss:new16.css
Error: Invalid CSS after ".../_animate.scss"": expected selector or at-rule, was "@include media-..."
on line 97 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style expanded landio.scss:new17.css
D:\0-scss\scss>sass --style expanded landio.scss:new18.css
Error: Invalid CSS after "...a-breakpoint-up": expected selector, was "(md)"
on line 94 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass -v
Sass 3.4.20 (Selective Steve)
D:\0-scss\scss>
D:\0-scss\scss>sass --style expanded landio.scss:new19.css
Error: Invalid CSS after "@import ": expected file to import (string or url()), was "media-breakpoin..."
on line 94 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style expanded landio.scss:new20.css
Error: @charset may only be used at the root of a document.
on line 6 of plugins/_animate.scss
from line 92 of landio.scss
Use --trace for backtrace.
D:\0-scss\scss>sass --style expanded landio.scss:new21.css
D:\0-scss\scss>