#!/bin/bash # #*************************************************************************** # Author: liwanggui # Date: 2021-08-20 # FileName: install-fpm.sh # Description: install fpm tools # Copyright (C): 2021 All rights reserved #*************************************************************************** # function install_ruby_from_source() { cd /usr/local/src yum install -y gcc openssl-devel make rpm-build if [ ! -f ruby-2.7.3.tar.gz ]; then wget https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.3.tar.gz fi tar xzf ruby-2.7.3.tar.gz cd ruby-2.7.3 ./configure --prefix=/usr/local/ruby make make install echo 'export PATH=/usr/local/ruby/bin:$PATH' > /etc/profile.d/ruby.sh source /etc/profile } function main() { ##install_ruby_from_source yum install -y ruby gem sources --add https://mirrors.aliyun.com/rubygems/ --remove https://rubygems.org/ gem install --no-document fpm } main