USA State list for Rails

Every time we need this migration script for our projects Use following command for Model generate [siwan@localhost siwan]$ ruby script/generate model UsStates exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/us_states.rb create test/unit/us_states_test.rb create test/fixtures/us_states.yml exists db/migrate create db/migrate/20091117115011_create_us_states.rb [siwan@localhost siwan]$ Open the /db/migrate/20091117115011_create_us_states.rb file and paste following code: class CreateUsStates ‘Alabama’, :abbreviation => ‘AL’ UsStates.create …

Issue with installing the mysql gem: solved, how to install mysql gem without issue

When tried to install mysql gem I got following error [root@localhost siwan]# sudo gem install mysql Building native extensions. This could take a while… ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb checking for mysql_ssl_set()… yes checking for rb_str_set_len()… no checking for rb_thread_start_timer()… yes checking for mysql.h… no checking for …

How to setup mongrel cluster setup on fedora

First install the following gems: #su #gem install mongrel #gem install mongrel_cluster #cd project_name #mongrel_rails cluster::configure -e production -p 3000 -N 3 -c /home/siwan/project_name -a 127.0.0.1 —-prefix /project_name # mongrel_rails cluster::start You are able to start your applicaton at http://127.0.0.1:3000, http://127.0.0.1:3001 and http://127.0.0.1:3002 for all the cluster # mongrel_rails cluster::stop Advanced prepairation for production realeaze …

How to use juggernaut in Rails project

Juggernaut is the Rails plugin for sending and receiving data in different thread. It gives you real time connection to server and you can implement different ideas work or fulfil your requirement. Juggernaut uses the eventmachine as a server. So install the supported gem first. #gem install json #gem install eventmachine #gem install juggernaut Juggernaut …