Archive for May 7th, 2008
Wednesday, May 7th, 2008
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.
No Comments » - Posted in linux, ruby on rails by kosmas
Wednesday, May 7th, 2008
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 [...]