建立私有 Gems 源

一、安裝依賴
yum install gem -y
gem install builder
 
二、安裝、配置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;     #添加認證文件路徑
}
 
三、將gem包copy到/home/mirrors/gems/gems目錄下
第一個gems目錄區分其餘mirrors repo
第二個gems目錄存放*.gem包
 
四、初始化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
 
五、安裝私有源的gem包。
gem install cocoapods-ks –source http://IP/gems/
相關文章
相關標籤/搜索