Wednesday, September 29, 2010

Rails find_by_sql returns object ??

you can use this,

ActiveRecord::Base.connection.select_value("sql query")

Tuesday, September 7, 2010

Installing pauldix-feedzirra

Hi when i tried to install pauldix-feedzirra, i got the below error.

sudo gem install pauldix-feedzirra
Building native extensions. This could take a while...
ERROR: Error installing pauldix-feedzirra:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... no
libxslt is missing. please visit for help with installing dependencies.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:

Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/nokogiri- for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/nokogiri-

Then, I installed dependencies,

sudo apt-get install libxml2-dev
sudo apt-get install libxslt-dev

Now tried

sudo gem install pauldix-feedzirra

Worked fine!!

Problems in Installing Curb in ubuntu

Just install the below lib files,

sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev

& then,

sudo gem install curb

It works!

-- source -

Sending HTML mail in rails

Hi pals,

If all the mails that you send are in HTML format. its simple. Specify this line in environment.rb

ActionMailer::Base.default_content_type = "text/html"

If only one action has to be in HTML mail, specify 'content_type' in that action.

content_type "text/html"


def signup_notification(recipient)
recipients recipient.email_address_with_name
subject "New account information"
from ""
content_type "text/html"