Created
October 19, 2017 09:45
-
-
Save hiroki-uchida/6cf227d9b703697afebb73e51ae5bb88 to your computer and use it in GitHub Desktop.
itame cookbook. ruby install by xbuild.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cookbooks/ruby/default.rb | |
# xbuildに必要なパッケージインストール | |
package 'git' | |
package 'gcc' | |
package 'openssl-devel' | |
package 'libyaml-devel' | |
package 'libffi-devel' | |
package 'readline-devel' | |
package 'zlib-devel' | |
package 'gdbm-devel' | |
package 'ncurses-devel' | |
# xbuildのインストール | |
git '/usr/local/xbuild' do | |
repository 'https://github.com/tagomoris/xbuild.git' | |
end | |
# rubyのインストール | |
execute "/usr/local/xbuild/ruby-install #{node[:ruby][:version]} /usr/local/ruby-#{node[:ruby][:version]}" do | |
not_if "test -e /usr/local/ruby-#{node[:ruby][:version]}" | |
end | |
# パスを通す | |
execute "echo 'export PATH=/usr/local/ruby-#{node[:ruby][:version]}/bin:$PATH' >> /root/.bashrc" do | |
not_if "grep 'export PATH=/usr/local/ruby-#{node[:ruby][:version]}/bin:$PATH' /root/.bashrc" | |
end | |
# パスを通す | |
execute "echo 'export PATH=/usr/local/ruby-#{node[:ruby][:version]}/bin:$PATH' >> /home/vagrant/.bashrc" do | |
not_if "grep 'export PATH=/usr/local/ruby-#{node[:ruby][:version]}/bin:$PATH' /home/vagrant/.bashrc" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# node.yml | |
ruby: | |
version: 2.4.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment