創建私有 Gems 源
阿新 • • 發佈:2019-02-21
efault nbsp mir 內容 basic auth quick con localtime 1、安裝依賴
yum install gem -y
gem install builder
2、安裝、配置nginx的文件列表
添加/etc/nginx/default.d/mirrors.conf文件如下內容
location ~ ^/ {
root /home/mirrors/;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
#auth_basic "secret"; #添加認證配置
#auth_basic_user_file /usr/share/nginx/passwd.db; #添加認證文件路徑
}
3、將gem包copy到/home/mirrors/gems/gems目錄下
第一個gems目錄區分其他mirrors repo
第二個gems目錄存放*.gem包
4、初始化gem repo
[root@stage19 /home/mirrors/gems] gem generate_index -d /home/mirrors/gems # 註意路徑
Generating Marshal quick index gemspecs for 27 gems
...........................
Complete
Generated Marshal quick index gemspecs: 0.013s
Generating specs index
Generated specs index: 0.001s
Generating latest specs index
Generated latest specs index: 0.000s
Generating prerelease specs index
Generated prerelease specs index: 0.000s
Compressing indicies
Compressed indicies: 0.000s
# 會生成如下文件和目錄
[root@stage19 /home/mirrors/gems] ls
gems latest_specs.4.8 latest_specs.4.8.gz prerelease_specs.4.8 prerelease_specs.4.8.gz quick specs.4.8 specs.4.8.gz
# 查看新生成文件的描述
gem generate_index -h
5、安裝私有源的gem包。
gem install cocoapods-ks –source http://IP/gems/
創建私有 Gems 源