Create a gist now

Instantly share code, notes, and snippets.

@np422 /install_rbenv.rb Secret
Created Jan 20, 2012

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
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"
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment