Skip to content

Instantly share code, notes, and snippets.

View lagartoflojo's full-sized avatar
🇨🇱
en 🇩🇪

Hernán Schmidt lagartoflojo

🇨🇱
en 🇩🇪
  • Nürnberg, Deutschland
View GitHub Profile
@lagartoflojo
lagartoflojo / README.markdown
Created July 21, 2011 22:33
Win/Mac/Linux Compatible Capistrano Recipe for Students of your Rails Course

TODO

  • Include basic Gemfile
  • Include Apache config
  • Specify available tasks
  • How to setup the students' PCs

Introduction

When giving a course based on Ruby on Rails, you will have many students coming from different backgrounds, using different Operating Systems, so you want their experience to be as smooth as possible. Deploying applications to the class server can be a pain in other frameworks, but in Rails, using Capistrano and Bundler, it is actually quite easy. This deploy configuration file for Capistrano intends to be as compatible with different OSs, as easy to use, and as complete as possible.

@lagartoflojo
lagartoflojo / deploy-fix.rb
Created April 15, 2011 01:15
Agregar al final de deploy.rb para arreglar problemas con deploy de capistrano en Windows.
on :start, "bundle:fix_gemfile"
namespace :bundle do
desc "Fix Gemfile.lock to use *nix gems"
task :fix_gemfile do
gem_file = File.read("Gemfile")
replace = gem_file.gsub(/(.*)gem (.*)win32(.*)\n/, "")
File.open("Gemfile", "w") {|file| file.puts replace}
gem_file_lock = File.read("Gemfile.lock")