Bundle Install Problem (sqlite3-1.3.4)

Installing sqlite3 (1.3.4) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb

Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.4 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.4/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.4), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v ’1.3.4′` succeeds before bundling.

Solution: gem install sqlite3 -v ’1.3.4′

mysql database backup

backup: mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

Restore is as follows:

# mysql -u root -ptmppassword 
mysql> create database sugarcrm;
Query OK, 1 row affected (0.02 sec)

# mysql -u root -ptmppassword sugarcrm < /tmp/sugarcrm.sql

# mysql -u root -p[root_password] [database_name] < dumpfilename.sql

Reference: http://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/

XMPP4R supports Chinese

*** parsers/baseparser.rb~ 2011-01-12 22:35:06.000000000 +0200
*** parsers/baseparser.rb 2011-01-12 22:35:06.000000000 +0200

*** 216,222 ****
version = version[1] unless version.nil?
encoding = ENCODING.match(results)
encoding = encoding[1] unless encoding.nil?
! @source.encoding = encoding
standalone = STANDALONE.match(results)
standalone = standalone[1] unless standalone.nil?
return [ :xmldecl, version, encoding, standalone ]
— 216,222 —-
version = version[1] unless version.nil?
encoding = ENCODING.match(results)
encoding = encoding[1] unless encoding.nil?
! @source.encoding = encoding unless encoding.nil?
standalone = STANDALONE.match(results)
standalone = standalone[1] unless standalone.nil?
return [ :xmldecl, version, encoding, standalone ]

Reference Link: http://pastie.org/1454110

Apache Proxy to Thin (ROR app server)

1. sudo a2enmod proxy
2. sudo a2enmod proxy_balancer
3. sudo a2enmod proxy_http
4. sudo a2enmod rewrite

5. sudo /etc/init.d/apache2 force-reload

6. sudo nano /etc/apache2/sites-available/domain.com

<VirtualHost *:80>
ServerName domain.com
ServerAlias www.domain.com

DocumentRoot /home/demo/public_html/railsapp/public

RewriteEngine On

<Proxy balancer://thinservers>
BalancerMember http://127.0.0.1:5000
BalancerMember http://127.0.0.1:5001
BalancerMember http://127.0.0.1:5002
</Proxy>

# Redirect all non-static requests to thin
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f

RewriteRule ^/http-bind(.*) http://127.0.0.1:5280%{REQUEST_URI} [P,QSA,L]
RewriteRule ^/(.*)$ balancer://thinservers%{REQUEST_URI} [P,QSA,L]

#ProxyPass / balancer://thinservers/
#ProxyPassReverse / balancer://thinservers/
#ProxyPreserveHost on

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

# Custom log file locations
ErrorLog /home/demo/public_html/railsapp/log/error.log
CustomLog /home/demo/public_html/railsapp/log/access.log combined

</VirtualHost>

Start ROR

source .bash_profile
rvm use 1.9.2 –default

sudo /etc/init.d/kannel stop
sudo -s
bearerbox -v 0
smsbox -v 0 &

rails runner script/send_sms.rb

rails runner script/xmpp4r_forwarder.rb
rails runner script/notifier.rb
bundle exec thin start –server 3