fpm包安装
【我的系统环境】
centos 6.5
【解决依赖关系】
安装依赖包
yum -y install ruby rubygems ruby-devel gcc
添加国内镜像
[[email protected]
~]# 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
[[email protected]
~]# 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 】
[[email protected]
~]# 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】
[[email protected]
~]# 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】
[[email protected]
~]# 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.
默认安装的是
[[email protected]
~]# ruby -v
ruby 1.8.7
(2013-06-27 patchlevel 374) [x86_64-linux]
解决办法: 1 更新ruby
解决办法2: 安装旧版本的fpm
[[email protected]
~]# gem install fpm -v 1.4.0