Skip to content

Instantly share code, notes, and snippets.

@tk0miya
Last active December 12, 2015 06:28
Show Gist options
  • Select an option

  • Save tk0miya/4729523 to your computer and use it in GitHub Desktop.

Select an option

Save tk0miya/4729523 to your computer and use it in GitHub Desktop.
Setup RVM and Ruby using rvm-capistrano. To install them, use "cap deploy:setup" !
# rvm setting
require "rvm/capistrano"
set :rvm_ruby_string , "ruby-1.9.3-p374@#{application}"
before 'deploy:setup', 'rvm:install_rvm'
before 'deploy:setup', 'rvm:install_ruby'
namespace :rvm do
desc "Install build dpendencies of Ruby"
task :install_build_depends do
pkgs = %w(gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel
libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel)
run "#{sudo} yum install -y " + pkgs.join(" ") + " || true", :shell => "bash"
# for CentOS 5.x
run "wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/autoconf26x-2.63-4.ius.el5.noarch.rpm -O /tmp/autoconf26x-2.63-4.ius.el5.noarch.rpm", :shell => "bash"
run "#{sudo} rpm -ivh /tmp/autoconf26x-2.63-4.ius.el5.noarch.rpm || true", :shell => "bash"
run "rm /tmp/autoconf26x-2.63-4.ius.el5.noarch.rpm", :shell => "bash"
end
before 'rvm:install_ruby', 'rvm:install_build_depends'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment