ruby incorrect encoding of pound sign(£)

Problem
You want to pass the £ sign to an http service, but the ruby CGI.escape encodes it incorrectly.

Solution
After using ruby’s CGI.escape for the string as:

sms_msg_tmp=CGI.escape(sms_code)

then replace the encoding with the pound sign encoding as in:

sms_msg=sms_msg_tmp.gsub('%C2%A3','%A3')

It should then pass the correct value for the £ sign.

Disabling rails web site when using mongrel,Apache,capistrano 1.4.1

Problem
You want to disable your rails web site for maintenance, but your application uses an older capistrano version than the one currently installed.

Solution
According to the RubyOnRails Cookbook recipe 13.12, it should only be a case of running cap disable_web (enable_web).
But in the meantime you have upgraded your capistrano version to version 2, and started using mongrel server as well.
So if you are using virtual severs and proxy with mongrel, the first thing to do is add the following in your Apache configuration file:

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [R]

If you needed to make the above change then you will have to restart apache in your server.

Then in your local pc you can run the following:

export REASON="Maintenance for MySQL upgrade"
export UNTIL="Sat May 10 15:30:00 2008"
cap _1.4.1_ disable_web (to put it in maintenance)
cap _1.4.1_ enable_web (to restart it again)