#!/bin/bash#byLCpanduan(){if[$?-ne0]thenecho"===============$1NOTOK===================="exit1fi}functioncheckRoot(){if[`id-u`-ne0]thenecho'PLEASESDOTHIS"su-"'&&\exit1fi}functionTARRUBY(){yumcleanallwget-O/etc/yum.repos.d/CentOS-Base.repohttp://mirrors.aliyun.com/repo/Centos-6.repoyum-yinstallrubyruby-develrubygemsmakegcclibxml2-devellibxslt-develgitlibicu*icu*#yumruby、gem及相关依赖gemsources-ahttps://ruby.taobao.org#更新gem源gemsources--removehttp://rubygems.org/panduanGEM\curl-sSLhttps://get.rvm.io|bash#rvmsource/etc/profile.d/rvm.sh#刷新rvmrpm-elibyaml-0.1.6-1.el6.x86_64--nodeps&>>/tmp/rvm.log#删除rvm执行rvminstall2.2.2时相关冲突的依赖包panduanRVMCURLrvminstall2.2.2#通过rvm更改ruby版本(gem只支持1.9.2及以后的版本)rvmuse2.2.2--default#使更改生效clearruby-e'p"helloruby"'#测试rubysleep3panduanRVMINSTALL}functionGOLLOM(){geminstallgollum#gem安装软件(如gollum)cd~#以下为针对gollum的操作,切到家目录mkdirwiki#创建wiki目录gitinit#初始化git生成.git文件panduangollumclearecho"##########################"echo"GULLUMISOK"echo"##########################"}main(){checkRootTARRUBYGOLLOM}main