0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS7.6にServerSpecをインストール ( Rubyコンパイル形式 )

Last updated at Posted at 2019-09-18

はじめに

CentOS7.6にServerSpecをインストール手順を記載する。
Rubyはバージョンが新しいもの(2.6.4)をインストールしたいので、yumを使わず、公式サイトのソースコードをコンパイルして、インストールする。

開発用のパッケージのインストール

コンパイル時などに必要となる諸々のパッケージをインストール。

yum -y install wget gcc zlib zlib-devel openssl openssl-devel

rubyのコンパイル

cd /usr/local/src
wget https://cache.ruby-lang.org/pub/ruby/ruby-2.6.4.tar.xz
tar xvf ruby-2.6.4.tar.xz

cd /usr/local/src/ruby-2.6.4
./configure
make; make instal

cd /usr/local/src/ruby-2.6.4
cd ./ext/openssl
ruby extconf.rb

vim Makefile
    ※ 下記の内容をファイルに追記する
    > top_srcdir = /usr/local/src/ruby-2.6.4

make; make instal

cd /usr/local/src/ruby-2.6.4
cd ./ext/zlib
ruby extconf.rb
vim Makefile
    > top_srcdir = /usr/local/src/ruby-2.6.4

make; make instal

serverspecのインストール

gemを使用して、以下をインストール。

  • serverspec : 本体

  • rake : Rubyのビルドプログラム(Ruby版のmakeみたいなもの)

  • highline : 標準出力に色を付けるgem

gem install serverspec rake highline
gem list serverspec

テスト環境の作成

mkdir -p /usr/local/src/test
cd /usr/local/src/test
serverspec-init

テストの実行

rake spec

参考

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?