Install monit: sudo apt-get install monit Edit the /etc/default/monit file and enable the start up flag, which ensures that the configuration is done so that monit can start. # vim /etc/default/monit startup=1 Configure monit: sudo vim /etc/monit/monitrc
Category Archives: RoR Development
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 […]
Ubuntu 12.04 setup Apache 2 with RoR 3
Connecting a Rails app on Windows to SQL Server
(1) For this to work properly, first you need to install the DevKit. Just download the executable from RubyInstaller and run it. For rails 2 choose 3.4.5 version. If it’s installed on C:DevKit, for example, then follow the next steps: cd C:DevKit ruby dk.rb init ruby dk.rb install gem install rdiscount –platform=ruby (2) Install the […]
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
Deploying a Subversion branch with Capistrano
Capistrano is a tool for automating tasks via SSH on remote servers. It has many uses, I (and many others) use it to deploy their (rails) applications. The best I can tell there is no built in way to deploy a branch from your source code control system. There are a couple ways of accomplishing […]
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 […]
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 […]