1.安装ruby环境
[root@oldboy /]# yum install -y ruby ruby-devel rubygems
gem install fpmgem sources --add https://mirrors.tuna.tsinghua.edu.cn/rubygems/ --remove https://rubygems.org/gem sources -lgem install fpmfpm -s dir -t rpm -n cosmo -v 8.0 1.txt 补充:如果遇到这样的报错Need executable 'rpmbuild' to convert dir to rpm {:level=>:error}一般是因为需要你安装rpmbuildyum -y install rpm-buildfpm -s dir -t rpm -n cosmo -v 8.0 1.txt