标签:fpm包安装
fpm包安装
【我的系统环境】
centos 6.5
【解决依赖关系】
安装依赖包
yum -y install ruby rubygems ruby-devel gcc
添加国内镜像
[root@ops-rpmbuild01 ~]# gem sources -a http://ruby.taobao.org/
改用
gem sources -a https://ruby.taobao.org/
移除默认的
gem sources --remove http://rubygems.org/
查看源
gem sources -l
【安装fpm包】
gem install fpm
改用
gem install fpm -v 1.4.0
[root@ops-rpmbuild01 ~]# gem install fpm -v 1.4.0
Successfully installed fpm-1.4.0
1 gem installed
Installing ri documentation for fpm-1.4.0...
Installing RDoc documentation for fpm-1.4.0...
参考:
http://www.jianshu.com/p/df61ea673838
【结果】
成功安装
fpm --version
1.4.0
【错误1 】
[root@ops-rpmbuild01 ~]# gem sources -a http://ruby.taobao.org/
Error fetching http://ruby.taobao.org/:
bad response Not Found 404 (http://ruby.taobao.org/specs.4.8.gz)
原因:淘宝停止基于 HTTP 协议的镜像服务 需要改用https的协议
【错误2】
[root@ops-rpmbuild01 ~]# gem install fpm
Building native extensions. This could take a while...
ERROR: Error installing fpm:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
creating Makefile
原因: 系统没有gcc环境 ,安装yum install gcc
【错误3】
[root@ops-rpmbuild01 ~]# gem install fpm
Building native extensions. This could take a while...
Building native extensions. This could take a while...
ERROR: Error installing fpm:
ruby-xz requires Ruby version >= 1.9.3.
默认安装的是
[root@ops-rpmbuild01 ~]# ruby -v
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
解决办法: 1 更新ruby
解决办法2: 安装旧版本的fpm
[root@ops-rpmbuild01 ~]# gem install fpm -v 1.4.0
本文出自 “崔德华运维打工从业路” 博客,请务必保留此出处http://cuidehua.blog.51cto.com/5449828/1774475
标签:fpm包安装
原文地址:http://cuidehua.blog.51cto.com/5449828/1774475