Nik, Le Sa had explained you how to configure the databases.yml.
Follow his instructions, but keep in mind that you would have to
configure the socket (if your mySQL server have one) and maybe your
mySQL host and port. For development and testing environment you
should use sqlite but in production you'll like a more robust database
engine.
Sample configuration for a production environment:
First, you said you are using redhat and you said you already have mysql
installed and rails installed. In that case you just need to have the
gem installed.
The gem is the hard part, depending on which "ruby" version you are
using. So, try the following first:
sudo gem install mysql
.. if you get failures installing that gem and you are using ruby 1.9.x
..
Do..
sudo gem install hectoregm-mysql-ruby
Once any of those gems installs.. test to make sure it works..
Run IRB
type require 'mysql'
The output should show => True
....
If you get this far then you just need to create your new project and
specify that you want to use mysql. You can do this a few ways. First
way is if you have a really good IDE (the IDE will do it for you when
you create your project (netbeans for example does this). The second
way is to specify your database in the database.yml file.
Then you need to run a rake DB create task to create the database based
on the specifications of the database.yml file.
rake db:create (which works for the current environment database
specified)
.. or ..
rake db:create:all (which creates all databases specified in
database.yml)
Thank u Älphä Blüë
I have a doubt please clarify..
How do we know the contents of the database.yml file.
does this command is the right one to use $vim /configure/database.yml
One more thing I am getting this thing if i go for rake
$rake db:migrate
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb,
Rakefile.rb)
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2377:in
`raw_load_rakefile'
(See full trace by running task with --trace)