Setup Rails

Ruby on Rails Development

Recommended editor: NetBeans. Other alternative: aptana.

Also see

Installing gems package manager locally

Also see and

export GEM_HOME=$HOME/lib/ruby/gems/1.8
export RUBYLIB=$HOME/lib/ruby:${HOME}/lib/site_ruby/1.8

Onthou om GEM_HOME en RUBYLIB in ~/.bashrc of ~/.profile te define. Sit ook /lib/ruby/gems/1.8/bin op die pad.

Download and unpack the Gems source from Run the setup.rb script with the right arguments to install into your home directory:

ruby setup.rb all --prefix=$HOME --siterubyver=$HOME/lib/site_ruby/1.8

This will install the gem command (and a couple of others) into $HOME/bin and the Gems source into $HOME/lib/site_ruby. Gems will be installed into $HOME/lib/ruby/gems/1.8. You should add $HOME/bin to your path. If you want to install it somewhere else replace $HOME with the prefix you'd like to use.

Install Rails itself

gem install rails --rdoc --ri --include-dependencies


mysql-server libmysql-ruby libopenssl-ruby

To check, create a ruby project:

rails demo

In the demo directory, do


To create database:

mysqladmin -u root create blah_development

To test database connection:

rake db:migrate


You can see that there are separate tables for development testing and production. This separation helps in the development and maintenance of Rails projects.

In a difference from earlier Rails versions, Rails 2.0 will create the databases needed with the command:
exchange$ rake db:create:all
(in /home/sean01/work/exchange)

Also see


Overview of new 2.0 features and how to handle the new scaffolding:

Useful things to remember

./script/generate scaffold product title:string description:text image_url:string
rake db:create
rake db:create:all
rake db:migrate
rake test:units

Tampering with cookies

If you see


then you need to clear the browser cookie cache.

MySQL tips

Use 'desc table' to view fields.

sub-sahara africa
sahara trip IanKnot rainbow