#!/usr/bin/perl -w # We’re strict use strict; # Get list of installed gems my @gems = qx(gem list); chomp(@gems); # Create commands foreach my $gem (@gems) { # Match gem and versions $gem =~ m/(S+)s((.+))/i; # Gem name $gem = $1; # Save them into array my @gem_versions = split(/,/, $2); # Print out commands […]
Tag Archives: rails
Ubuntu 12.04 setup Apache 2 with RoR 3
How to install Rails 3.0 and Ruby 1.9.2 on Ubuntu
Install RVM 1.0.1 First be sure to do a quick update before you get started. sudo apt-get update Next install curl and git so we can pull down ruby via rvm sudo apt-get install curl git-core Now that you’re all set up, install RVM itself. This is done via a shell script which you can […]
Export to Excel in Rails: to_xls Plugin
This gem transform an Array into a excel file using the spreadsheet gem. Usage @users = User.all @users.to_xls @users.to_xls(:headers => false) @users.to_xls(:columns => [:name, :role]) @users.to_xls(:columns => [:name, {:company => [:name, :address]}]) @users.to_xls(:columns => [:name, {:company => [:name, :address]}], :headers => [:name, :company, :address]) In order to send a file from the controller, you can […]