4
8

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.

Serverspec (2/3) :スタンドアロン環境へのServerspecインストール

Last updated at Posted at 2014-03-29

スタンドアロン環境へServerspecへインストールしてみる。

資材のダウンロード

  • Rubyのダウンロード
    RHEL同梱版ではServerspecのインストールでwarningが出るため最新版を導入する。
    以下からダウンロード、/tmpに格納
    Ruby 2.1.1
    https://www.ruby-lang.org/ja/



Serverspecのインストール

Serverspecのインストール要件であるRubyとRubyGemsをインストールする。
1.Rubyのインストール

# cd /tmp
# tar zxvf ruby-2.1.1.tar.gz
# cd ruby-2.1.1
# ./configure 
# make
# make install

2.RubyGemsのインストール

# cd /tmp
# tar zxvf rubygems-2.2.2.tgz 
# cd rubygems-2.2.2
# ruby setup.rb 

3.Serverspecのインストール

# cd /tmp/serverspec
# gem install serverspec --local




もし以下のエラーが出た場合は追加手順が必要。

# gem install serverspec --local
ERROR:  Loading command: install (LoadError)
	cannot load such file -- zlib
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

zlibをインストールしただけでは解決できなかったが、以下のコマンドで補えるらしい。

# cd /tmp/ruby-2.1.1/ext/zlib
# ruby extconf.rb
# make
# make install

コマンド実行後、再度Serverspecのインストールを行う。


お疲れ様でした。


参考:Serverspecインストール時のエラーログ
[root@nhss01 serverspec]# gem install serverspec --local
Successfully installed net-ssh-2.8.0
Successfully installed rspec-core-2.14.8
Successfully installed diff-lcs-1.2.5
Successfully installed rspec-expectations-2.14.5
Successfully installed rspec-mocks-2.14.6
Successfully installed rspec-2.14.1
Successfully installed highline-1.6.21
Successfully installed specinfra-1.0.1
Successfully installed serverspec-1.0.0
Installing ri documentation for diff-lcs-1.2.5
/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Installing ri documentation for highline-1.6.21
/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Installing ri documentation for net-ssh-2.8.0
/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Installing ri documentation for rspec-2.14.1
/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Installing ri documentation for rspec-core-2.14.8
/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Installing ri documentation for rspec-expectations-2.14.5
/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Installing ri documentation for rspec-mocks-2.14.6
/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Installing ri documentation for serverspec-1.0.0
/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Installing ri documentation for specinfra-1.0.1
/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Done installing documentation for diff-lcs, highline, net-ssh, rspec, rspec-core, rspec-expectations, rspec-mocks, serverspec, specinfra after 15 seconds
9 gems installed

Rdocに関するエラー。Rubyが古いと出るらしい。。。

4
8
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
4
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?