Setting up a new Rails app using version 3.0 I found that the default database engine is SQLite 3. For various inconsequential reasons I prefer MySQL, so I did a little research on how to create an app already configured for use with MySQL. As Ubuntu is (for now) my Linux distro of choice, these instructions are specific to that OS.
First, make sure you have the MySQL packages installed on your system. Use either the command line or, more simply, the Synaptic Package Manager to install these, including the MySQL client and lib packages.
Second, assuming you've already installed Ruby and have the rails gem, also gem install mysql.
At this point you can simply create the new app, defining MySQL as the default database.
$ rails new example_app -d mysql
Check out the Gemfile and you'll see MySQL listed there. You are good to go!
0 comments:
Post a Comment