views:

40

answers:

1

i installed rails on ruby and i have mysql as a database installed now how i interacts with datbase uisng rails ,will i have to install mysql gems for ruby or what first step i have to do. in tutorials its written like that creates your rails applicationl like

rails appname

cd to appname

rails appname -d mysql

will it be enough to start interaction with mysql database without installing mysql gems??

+1  A: 

Short answer is yes. If you installed rails, you most likely already have the mysql gem installed. If for some reason you don't, you can install it with gem install mysql.

CaptainAwesomePants
thanks..means without installing mysql gem i can't interact with data base
Amit singh tomar
nd one more thing whats mysql gem will do ,it it there to make bridge between rails and mysql database??
Amit singh tomar
Yes, exactly. It is equivalent to C's MySQL API (because it pretty much IS that API with some Ruby bindings). http://www.tmtm.org/en/mysql/ruby/
CaptainAwesomePants
You will have to modify config/database.yml if your mysql is password protected or you are not going to run as root.Then run 'rake db:create' to create the database.
cmpolis