# # Cookbook Name:: ruby_enterprise # Recipe:: default # # Author:: Joshua Timberman () # Author:: Sean Cribbs () # Author:: Michael Hale () # # Copyright:: 2009-2010, Opscode, Inc. # Copyright:: 2009, Sean Cribbs # Copyright:: 2009, Michael Hale # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # include_recipe "build-essential" packages = value_for_platform( ["centos","redhat","fedora"] => {'default' => ['readline-devel', 'openssl-devel', 'patch']}, "default" => ['libssl-dev', 'libreadline5-dev'] ) packages.each do |pkg| package pkg end remote_file "/tmp/ruby-enterprise-#{node[:ruby_enterprise][:version]}.tar.gz" do source "#{node[:ruby_enterprise][:url]}.tar.gz" not_if { ::File.exists?("/tmp/ruby-enterprise-#{node[:ruby_enterprise][:version]}.tar.gz") } end bash "Install Ruby Enterprise Edition" do cwd "/tmp" code <<-EOH tar zxf ruby-enterprise-#{node[:ruby_enterprise][:version]}.tar.gz ruby-enterprise-#{node[:ruby_enterprise][:version]}/installer \ --auto=#{node[:ruby_enterprise][:install_path]} EOH not_if do ::File.exists?("#{node[:ruby_enterprise][:install_path]}/bin/ree-version") && system("#{node[:ruby_enterprise][:install_path]}/bin/ree-version | grep -q '#{node[:ruby_enterprise][:version]}$'") end end execute "Installing bundler" do command "#{node[:ruby_enterprise][:install_path]}/bin/gem install bundler" not_if "#{node[:ruby_enterprise][:install_path]}/bin/gem list -l bundler$ | grep -q bundler" end # Remove since ree-installed passenger causes a conflict with our specified version execute "Uninstall passenger" do command "#{node[:ruby_enterprise][:install_path]}/bin/gem uninstall -Iax passenger" end execute "Updating rubygems" do command "#{node[:ruby_enterprise][:install_path]}/bin/gem update --system #{node[:ruby_enterprise][:gems_version]}" end