public
Created

  • Download Gist
install_rbenv.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
 
namespace :deploy do
desc "install rbenv needed for hemnet"
task :install_rbenv, :roles => :app do
run "curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash"
init_string = '
if [[ -d $HOME/.rbenv ]]; then
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims/:$PATH"
eval "$(rbenv init -)"
fi
'
put init_string , "/tmp/add_to_dot-files"
run "grep -q rbenv ~/.bashrc || cat /tmp/add_to_dot-files >> ~/.bashrc"
run "grep -q rbenv ~/.bash_profile || cat /tmp/add_to_dot-files >> ~/.bash_profile"
end
end
install_ruby.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13
 
namespace :deploy do
desc "install ruby needed for hemnet"
task :install_ruby, :roles => :app do
run "rbenv install 1.9.2-p290"
run "rbenv global 1.9.2-p290"
end
end
 
 
before "deploy:install_ruby", "deploy:install_rbenv"
before "deploy:install_rubygem" , "deploy:install_ruby"
before "deploy:setup", "deploy:install_rubygem"
install_rubygem.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12
 
namespace :deploy do
desc "install rubygem version needed for hemnet"
task :install_rubygem, :roles => :app do
rvm_cmds = [
"gem update --system 1.5.3" ,
"gem install bundler -v 1.0.21"
].each do |cmd|
run cmd
end
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.