LoginSignup
0
0

More than 1 year has passed since last update.

【Rails】global source lines

Last updated at Posted at 2021-11-27

##global source lines 
Gemfileに記述されるgemに対してsource、git、pathのオプションを指定しなければ、Gemfileの一行目にある引数のサイトから取得される。

source "https://rubygems.org"

このsourceメソッドの行はマニュアル内で global source lines と呼ばれる事がある。

###sourceオプション 
gemを検索するサイトを取得

gem "gem_name", source: "url"

#全てのオプションで、ブロックを用いて一括で書ける
source 'url' do
  gem 'gem_name1'
  gem 'gem_name2'
end

####pathオプション 
ファイルシステム内のパスを指定し、gemの取得先とする

gem "gem_name", path: "url"

###gitオプション 
作成されたgemのgitリポジトリから取得

gem "gem_name", git: "url"
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0