Bundler에서 SASS 및 Compass 및 SASS 버전 Bootstrap을 버전 지정하여 설치하는 방법

RubyGems에서 SASS, Compass 및 SASS 버전 Bootstrap을 설치하는 방법 - Qiita 의 때와는 다른 방법으로 인스톨 해 보려고 했습니다.

환경
  • OS : Windows10 64bit
  • RubyGems : 2.6.12

  • 설치할 것
  • Bundler : 1.15.1
  • SASS : 3.4.24 (Selective Steve)
  • Compass : 1.0.3 (Polaris)
  • Bootstrap : bootstrap-sass-3.3.7

  • RubyGems 설치



    Windows10에 RubyGems를 설치하는 방법 - Qiita

    RubyGems 최신화


    $ gem -v
    2.6.11
    
    $ gem update --system
    RubyGems 2.6.12 installed
    Parsing documentation for rubygems-2.6.12
    Installing ri documentation for rubygems-2.6.12
    
    === 2.6.12 / 2017-04-30
    
    Bug fixes:
    
    * Fix test_self_find_files_with_gemfile to sort expected files. Pull
      request #1880 by Kazuaki Matsuo.
    * Fix issue for MinGW / MSYS2 builds and testing. Pull request #1879 by
      MSP-Greg.
    * Fix gem open to open highest version number rather than lowest. Pull
      request #1877 by Tim Pope.
    * Add a test for requiring a default spec as installed by the ruby
      installer. Pull request #1899 by Samuel Giddins.
    * Fix broken --exact parameter to gem command. Pull request #1873 by Jason
      Frey.
    * [Installer] Generate backwards-compatible binstubs. Pull request #1904
      by Samuel Giddins.
    * Fix pre-existing source recognition on add action. Pull request #1883 by
      Jonathan Claudius.
    * Prevent negative IDs in output of #inspect. Pull request #1908 by Vít
      Ondruch.
    * Allow Gem.finish_resolve to respect already-activated specs. Pull
      request #1910 by Samuel Giddins.
    
    === 2.6.11 / 2017-03-16
    
    Bug fixes:
    <省略>
    RubyGems installed the following executables:
            C:/app/Ruby24-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.
    
    Updating rubygems-update
    Successfully installed rubygems-update-2.6.12
    Parsing documentation for rubygems-update-2.6.12
    Installing darkfish documentation for rubygems-update-2.6.12
    Done installing documentation for rubygems-update after 174 seconds
    Parsing documentation for rubygems-update-2.6.12
    Done installing documentation for rubygems-update after 0 seconds
    Installing RubyGems 2.6.12
    RubyGems system software updated
    
    $ gem -v
    2.6.12
    

    Bundler 설치





    Bundler라는 것은...

    대략적인 번역 : 응용 프로그램 종속성을 관리하고 여러 컴퓨터에서 체계도 반복적으로 응용 프로그램을 설치할 수 있습니다.

    Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably
    bundler | RubyGems.org | 귀하의 커뮤니티 젬 호스트

    ※. 영어는 매우 약하기 때문에 누군가 초보자용 한마디 번역이 있으면 알려주세요.
    $ gem install bundler
    Successfully installed bundler-1.15.1
    Parsing documentation for bundler-1.15.1
    Installing ri documentation for bundler-1.15.1
    Done installing documentation for bundler after 38 seconds
    1 gem installed
    
    $ bundler -v
    Bundler version 1.15.1
    

    Gemfile 만들기


    # カレントディレクトリにシンプルなGemfile作成する
    $ bundle init
    Writing new Gemfile to C:/Users/UserName/Gemfile
    # Gemfileを編集する
    $ vi Gemfile
    ## ------ ここからGemfileの内容-------------
    # frozen_string_literal: true
    source "https://rubygems.org"
    
    # gem "rails"
    ## ----ここから下を追記する-----------
    gem 'compass','1.0.3'
    gem 'bootstrap-sass','3.3.7'
    
  • Gemfile을 쓰는 방법은 가 참고가 되었습니다.
  • gemfile - 참조 - - Rails 문서


  • Bundler로 설치


    $ bundle install
    Fetching gem metadata from https://rubygems.org/............
    Fetching version metadata from https://rubygems.org/...
    Fetching dependency metadata from https://rubygems.org/..
    Resolving dependencies...
    Fetching chunky_png 1.3.8
    Installing chunky_png 1.3.8
    Fetching multi_json 1.12.1
    Installing multi_json 1.12.1
    Fetching sass 3.4.24
    Installing sass 3.4.24
    Fetching rb-fsevent 0.9.8
    Installing rb-fsevent 0.9.8
    Fetching ffi 1.9.18 (x64-mingw32)
    Installing ffi 1.9.18 (x64-mingw32)
    Fetching execjs 2.7.0
    Installing execjs 2.7.0
    Using bundler 1.15.1
    Fetching compass-core 1.0.3
    Installing compass-core 1.0.3
    Fetching compass-import-once 1.0.5
    Installing compass-import-once 1.0.5
    Fetching rb-inotify 0.9.10
    Installing rb-inotify 0.9.10
    Fetching autoprefixer-rails 7.1.1.2
    Installing autoprefixer-rails 7.1.1.2
    Fetching compass 1.0.3
    Installing compass 1.0.3
    Fetching bootstrap-sass 3.3.7
    Installing bootstrap-sass 3.3.7
    Bundle complete! 2 Gemfile dependencies, 13 gems now installed.
    Use `bundle info [gemname]` to see where a bundled gem is installed.
    Post-install message from compass:
    $ sass -v
    Sass 3.4.24 (Selective Steve)
    $ compass -v
    Compass 1.0.3 (Polaris)
    Copyright (c) 2008-2017 Chris Eppstein
    Released under the MIT License.
    Compass is charityware.
    Please make a tax deductable donation for a worthy cause: http://umdf.org/compass
    

    Gemfile.lock 확인


    bundle install 하면 Gemfile과 같은 위치에 Gemfile.lock이 만들어집니다.
    Gemfile.lock은 뭔가에 대해 가 매우 이해하기 쉬웠습니다.

    gemfile.lock은 실제로 gem을 설치 한 후 "결과도"와 같습니다. gem끼리는 서로 관련되어 있는 경우가 많기 때문에, gemfile에 써 있는 gem 외에도 필요한 gem가 생깁니다. Bundler는 자동으로 설치하고 gemfile.lock에 작성합니다.
    (생략)
    gemfile.lock을 사용하면 모든 환경에서 동일한 gem, gem 버전을 사용할 수 있습니다.
    bundle install과 bundle update의 차이점 - Qiita
    $ ls -l | grep 'Gemfile'
    -rw-r--r-- 1 m-uki 197609     126 6月  26 22:36 Gemfile
    -rw-r--r-- 1 m-uki 197609     808 6月  26 23:10 Gemfile.lock
    $ vi Gemfile.lock
    --------ここからGemfile.lockの内容--------------
    GEM
      remote: https://rubygems.org/
      specs:
        autoprefixer-rails (7.1.1.2)
          execjs
        bootstrap-sass (3.3.7)
          autoprefixer-rails (>= 5.2.1)
          sass (>= 3.3.4)
        chunky_png (1.3.8)
        compass (1.0.3)
          chunky_png (~> 1.2)
          compass-core (~> 1.0.2)
          compass-import-once (~> 1.0.5)
          rb-fsevent (>= 0.9.3)
          rb-inotify (>= 0.9)
          sass (>= 3.3.13, < 3.5)
        compass-core (1.0.3)
          multi_json (~> 1.0)
          sass (>= 3.3.0, < 3.5)
        compass-import-once (1.0.5)
          sass (>= 3.2, < 3.5)
        execjs (2.7.0)
        ffi (1.9.18-x64-mingw32)
        multi_json (1.12.1)
        rb-fsevent (0.9.8)
        rb-inotify (0.9.10)
          ffi (>= 0.5.0, < 2)
        sass (3.4.24)
    
    PLATFORMS
      x64-mingw32
    
    DEPENDENCIES
      bootstrap-sass (= 3.3.7)
      compass (= 1.0.3)
    
    BUNDLED WITH
       1.15.1
    

    좋은 웹페이지 즐겨찾기