Skip to content

Instantly share code, notes, and snippets.

@ffaerber
Created July 3, 2014 08:17
Show Gist options
  • Save ffaerber/6a5020d70d91a082cea7 to your computer and use it in GitHub Desktop.
Save ffaerber/6a5020d70d91a082cea7 to your computer and use it in GitHub Desktop.
ruby build chef
include_recipe 'ruby_build'
file "/etc/gemrc" do
content <<-EOS
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
EOS
owner "root"
mode 0644
end
ruby_build_ruby node[:rails_app][:ruby_version] do
prefix_path "/usr/local/ruby/ruby-#{node[:rails_app][:ruby_version]}"
action :install
end
gem_package 'bundler' do
gem_binary "/usr/local/ruby/ruby-#{node[:rails_app][:ruby_version]}/bin/gem"
end
['ruby', 'gem', 'bundle'].each do |bin|
link "/usr/local/bin/#{bin}" do
to "/usr/local/ruby/ruby-#{node[:rails_app][:ruby_version]}/bin/#{bin}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment