Its all about Ruby On Rails
ruby
uninitialized constant ActionMailer::Quoting::Encoding
Apr 13th
Just a quick note, If you are getting “uninitialized constant ActionMailer::Quoting::Encoding” while using ActionMailer, then make sure that your mailer look like:
class Notifier < ActionMailer::Base
def signup_notification(recipient)
recipients recipient.email_address_with_name
bcc ["bcc@example.com"]
from "system@example.com"
subject "New account information"
body :account => recipient
end
end
Actually, yesterday we were getting “uninitialized constant ActionMailer::Quoting::Encoding” while using ActionMailer in production but it was working fine in all modes(development/production) on localhost. Our mailer was like:
class Notifier < ActionMailer::Base
def signup_notification(recipient)
@recipients = recipient.email_address_with_name
@bcc = ["bcc@example.com"]
@from = "system@example.com"
@subject = "New account information"
@body = :account => recipient
end
end
We could not find the actual issue with this mailer. But the above said error was disappeared when we changed the same mailer as following:
class Notifier < ActionMailer::Base
def signup_notification(recipient)
recipients recipient.email_address_with_name
bcc ["bcc@example.com"]
from "system@example.com"
subject "New account information"
body :account => recipient
end
end
Do you guys have any idea? I would love to listen from you.
Update: No its not solved yet. Still same issue. May be some issue with character encoding with the TMail object.
Update 2: This was the issue http://github.com/hmcgowan/roo/issues#issue/4/comment/106328
Multiple versions of ruby on ubuntu
Jun 23rd
Three-Four days ago I was in a situation where I need to have multiple versions of ruby and rubygems on my ubuntu machine. I was lucky, I found an awesome article http://blog.michaelgreenly.com/2008/08/multiple-versions-of-ruby-on-ubuntu-2.html. This really solved my problem, Many thanks to Michael Greenly.
Taskit: Another task scheduler for rails
May 21st
While searching something I found and interesting plugin ‘Taskit‘, which I want to test for sure in production/staging when ever I get the chance.
Anybody tried it already?
Printing large image diagrams generated by RailRoad
Mar 23rd
I use RailRoad for generating Ruby on Rails diagrams, but always wish I could print those diagrams. Generally diagrams are too big to print on a single A4 size paper and I didn’t find any tool to print larger images in parts so that I can join them. If I print the image generated by RailRoad on single page, it of no use as it is hardly readable.
Fortunately, two days ago I found something which resolved this issue. It is a linux command and print a particular image on four pages. Here is that command:
lp -o scaling=200 models.png
Hassle free installation of rails stack on debian based system
Feb 23rd
Want to install rails stack on a machine? Just follow these steps. It will setup a rails stack(Apache + passenger + mysql + ruby + rubygems + common gems + git) on any server(debian based)
- apt-get update
- apt-get upgrade -y
- apt-get -y install build-essential libssl-dev libreadline5-dev zlib1g-dev
- apt-get -y install mysql-server libmysqlclient15-dev mysql-client
- apt-get -y install ruby ruby1.8-dev irb ri rdoc libopenssl-ruby1.8
- install rubygems manually:
- download rubygems form rubyforge, >=1.3
- unzip files
- ruby setup.rb
- Check that gem command is in path. Sometimes ‘gem1.8′ is available but ‘gem’ not. In that case copy /usr/bin/gem1.8 to /usr/bin/gem using “cp /usr/bin/gem1.8 /usr/bin/gem”
- apt-get -y install libmagick9-dev
- apt-get -y install imagemagick
- apt-get -y install postfix mailx
- apt-get -y install apache2
- apt-get -y install apache2-prefork-dev
- wget http://webonrails.com/wp-content/plugins/download-monitor/download.php?id=7
- ruby install_gems.txt
- passenger-install-apache2-module
-
Download git from git-scm.com
- Unzip files
- ./configure –without-tcltk
- make -j 2
- make install
You are all set now, go deploy you rails app. I have tested it on linode(ubuntu8.10), slicehost(ubuntu 8.10), should work for you too