Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Dr Nic Williams http://drnicwilliams.com

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Upgrade rubygems and/or specific gems themselves via capistrano

When a latest RubyGems is released (e.g. 0.9.5 recently) or Rails (e.g. 2.0.2) you might want to push those upgrades to all your production machines.

Add these two tasks to your deploy.rb capistrano file (add namespaces for cap2.0 if you like)

  desc "Updates RubyGems version"
  task :gem_update_system do
    sudo "gem update --system"
  end

    
  desc "Install a RubyGem from remote source"
  task :gem_install do
    puts "USAGE: GEM=gemname cap gems_install" and next unless ENV['GEM']
    sudo "gem install #{ENV['GEM']} --no-ri --no-rdoc"
  end


To upgrade rubygems and rails, for example:

cap gem_update_system
GEM=rails cap gem_install

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS