Reinstalling list of GEMs on a new server

#!/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 […]

Zlib buffer error on gem install

if gem update –system not works and rename ruby/bin/zlib1.dll to zlib.dll not helps try: Open file RUBY_DIRlibrubysite_ruby1.8rubygems.rb And replace existed def self.gunzip(data) by this: def self.gunzip(data) require ‘stringio’ require ‘zlib’ data = StringIO.new data # Zlib::GzipReader.new(data).read data.read(10) # skip the gzip header zis = Zlib::Inflate.new(-Zlib::MAX_WBITS) is = StringIO.new(zis.inflate(data.read)) end

How to install RMagick + ImageMagick

Installation on Windows Issues: A. This version of RMagick was created to run with ImageMagick 6.3.0 but ImageMagick 6.3.5 is installed on this system. You should either 1) Configure and build RMagick for ImageMagick 6.3.5, or 2) download ImageMagick 6.3.0 from http://www.imagemagick.org and install it. B. Errors about missing CORE_.. .dll file(s). C. Errors about […]

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 […]