安装ruby模块
[root@c01 ~]# yum install ruby rubygems ruby-devel -y
# 查看当前使用的rubygems仓库
[root@c01 ~]# gem sources list
*** CURRENT SOURCES *** http://rubygems.org/
添加国内的 淘宝的Rubygems仓库
[root@c01 ~]# gem sources --add http://gems.ruby-china.org
http://gems.ruby-china.org added to sources
[root@c01 ~]# gem sources list
*** CURRENT SOURCES *** http://rubygems.org/
http://gems.ruby-china.org 移除原生的RUBY仓库
[root@c01 ~]# gem sources -r http://rubygems.org/
http://rubygems.org/ removed from sources
[root@c01 ~]# gem sources list
*** CURRENT SOURCES *** http://gems.ruby-china.org
FPM参数说明:
常用参数
-s 指定源类型 (例如dir 目录)
-t 指定目标类型,即想要制作为什么包 (比如想做个rpm包)
-n 指定包的名字 ,-name
-v 指定包的版本号 (用于区分rpm,有同名字但版本不同)
-C 指定打包的相对路径 Change directory to here before searching forfiles
-d 指定依赖于哪些包
-f 第二次打包时目录下如果有同名安装包存在,则强制覆盖它
-p 输出的安装包的目录,不想放在当前目录下就需要指定
--post-install 执行rpm包之后所要运行的脚本;同--after-install
--pre-install 软件包安装完成之前所要运行的脚本;同--before-install
--post-uninstall 软件包卸载完成之后所要运行的脚本;同--after-remove
--pre-uninstall 软件包卸载完成之前所要运行的脚本;同--before-remove 安装fpm及json依赖包, 之前确定经已装了gcc
[root@c01 ~]# gem install json -v 1.8.3
Building native extensions. This could take a while...
Successfully installed json-1.8.3
1 gem installed
Installing ri documentation for json-1.8.3...
Installing RDoc documentation for json-1.8.3...
[root@c01 ~]# gem install fpm -v 1.3.3
Building native extensions. This could take a while...
Successfully installed cabin-0.9.0
Successfully installed backports-3.8.0
Successfully installed arr-pm-0.0.10
Successfully installed clamp-0.6.5
Successfully installed ffi-1.9.18
Successfully installed childprocess-0.7.0
Successfully installed fpm-1.3.3
7 gems installed
Installing ri documentation for cabin-0.9.0...
Installing ri documentation for backports-3.8.0...
Installing ri documentation for arr-pm-0.0.10...
Installing ri documentation for clamp-0.6.5...
Installing ri documentation for ffi-1.9.18...
Installing ri documentation for childprocess-0.7.0...
Installing ri documentation for fpm-1.3.3...
Installing RDoc documentation for cabin-0.9.0...
Installing RDoc documentation for backports-3.8.0...
Installing RDoc documentation for arr-pm-0.0.10...
Installing RDoc documentation for clamp-0.6.5...
Installing RDoc documentation for ffi-1.9.18...
Installing RDoc documentation for childprocess-0.7.0...
Installing RDoc documentation for fpm-1.3.3...
gem从rubygem仓库安装软件类似yum从yum仓库安装软件。首先安装低版本的json,高版本的json需要ruby2.0以上,然后安装低版本的fpm,够用就行。

由于没安装rpm-build

yum install rpm-build

制做rpm包工具fpm安装的更多相关文章

  1. linux制做RPM包

    制作rpm包 1.制作流程 1.1 前期工作 1)创建打包用的目录rpmbuild/{BUILD,SPECS,RPMS, SOURCES,SRPMS} 建议使用普通用户,在用户家目录中创建 2)确定好 ...

  2. 如何使用yum来下载RPM包而不进行安装

    如何使用yum来下载RPM包而不进行安装 2015-03-23 13:15 theo-l译 linux.cn 字号:T | T yum是基于Red Hat的系统(如CentOS.Fedora.RHEl ...

  3. 在centos使用rpm包的方式安装mysql,以及更改root密码

    在centos使用rpm包的方式安装mysql,对于centos官方实际推荐使用yum进行安装,下载安装的方式主要用于内网服务器不能连接外网yum源的情况. 下载包 首先根据centos版本在mysq ...

  4. 用yum下载rpm包(不安装)到制定目录

    用yum下载rpm包(不安装)到制定目录用yum下载rpm包 www.pcjsh.com  1.安装yum-downloadonly # yum install yum-downloadonly -y ...

  5. 用yum下载rpm包(不安装)到指定目录

    用yum下载rpm包(不安装)到制定目录    用yum下载rpm包   1.安装yum-downloadonly   # yum install yum-downloadonly -y     2. ...

  6. centos7上Jenkins通过rpm包方式直接安装及使用war包方式升级

    一.通过rpm包方式直接安装jenkins 1.官网下载rpm安装包(前提是安装jdk) wget https://pkg.jenkins.io/redhat-stable/jenkins-2.121 ...

  7. rpm打包工具---FPM

    FPM的安装:fpm是由ruby gem仓库里面安装的所以要先装ruby.yum安装的ruby版本是1.8.7版本,使用gem命令会报错: >= 1.9.3,所以要安装一个比1.9.3版本高的 ...

  8. CentOS 下 rpm包与 yum 安装与卸载

    rpm包的安装:      1.安装一个包 # rpm -ivh 2.升级一个包 # rpm -Uvh 3.移走一个包 # rpm -e 4.安装参数 --force 即使覆盖属于其它包的文件也强迫安 ...

  9. 制做RPM包

    http://nmshuishui.blog.51cto.com/1850554/1583117 [root@NGM ~]# yum install pcre-devel zlib-devel ope ...

随机推荐

  1. 什么是XML RPC?

    # -*- coding: cp936 -*- #python 27 #xiaodeng #什么是XML RPC? #中文叫:远程过程调用 #使用http协议做传输协议的rpc机制,使用xml文本的方 ...

  2. java 怎么打印变量

    //Test.java public class Test16{ public static void main(String args[]){ int age=28; System.out.prin ...

  3. Linux的telent服务

    目前,在Win/Linux下telnet都很少用了,只是因为数据在传输的过程,未加密!不过在Linux下还是多用于端口探测,今天就来回顾曾经的telnet 1.介绍 Linux被广泛运用到各种服务器及 ...

  4. UVA 10539 - Almost Prime Numbers(数论)

    UVA 10539 - Almost Prime Numbers 题目链接 题意:给定一个区间,求这个区间中的Almost prime number,Almost prime number的定义为:仅 ...

  5. js template实现方法

    <script type="text/html" id="template"> <li class="list-item" ...

  6. 设置mysql group_concat长度

    #在MySQL配置文件(my.ini)中默认无该配置项,使用默认值时,值为1024,可在客户端执行下列语句修改: #SET GLOBAL group_concat_max_len = 1024; #该 ...

  7. github不能访问、加载css、js解决办法

    很奇怪,白天在公司还能正常访问github,晚上回来访问却有问题,表现症状是页面加载慢,并且页面样式明显错乱. 在chrome下用F12开发者工具一看,有2条css和2条js 404 了,猜想应该是g ...

  8. python配置文件转dict

    配置文件有很多种,如JSON,properties,conf,xml等. 除非需要跟别的语言进行交互,python本身是完全可以取代所有配置文件的.使用python进行配置可以使用非常灵活地执行一些逻 ...

  9. CreateThread与_beginthread, _beginthreadex创建线程的基本概念和区别

    这三个函数都可以创建新的线程,但都是如何创建的呢?当然MSDN文档最权威: Creates a thread to execute within the virtual address space o ...

  10. SQL2000的系统表sysproperties在SQL2005中 无效的 问题

    有两种解决办法 方法一.是我在网上找的:将原来的sysproperties改成sys.extended_properties并且对应关系如下 sys.extended_properties left ...