最終更新:2020-04-09 (木) 14:19:05 (1475d)  

Gemfile
Top / Gemfile

Bundler用の設定ファイル

gem ライブラリ名 [, バージョン, オプション]

http://railsdoc.com/references/gemfile

必須

  • source "http://rubygems.org"

バージョン指定

  • x.x.xバージョンを固定
    >= x.x.xx.x.x以上のバージョンが必要
    >= x.x.x, < y.y.yx.x.x以上、y.y.y以下のバージョンが必要
    ~> x.0x.1からx.9は良いが、メインのバージョンがあがるとは不可
    例えば、3.2は良いが、4.0は不可など

bundle init

  • # frozen_string_literal: true
    
    source "https://rubygems.org"
    
    git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
    
    # gem "rails"

関連

  • Gemfile.lock?