Prev | Current Page 436 | Next

Brad Ediger

"Advanced Rails"

0.
In order to run the ActiveRecord unit tests, you will need to create test databases.
Thankfully, there are some Rake tasks that automate this process. For a full test of
the ???big four??? connection adapters from the ground up, follow these steps:
1. Install and configure the database servers: MySQL, PostgreSQL, SQLite, and
SQLite3. The client libraries also need to be installed; these are installed with the
server binaries but can be installed separately if the server is on a remote
machine.
For MacPorts users, SQLite 2 can be installed with sudo port install sqlite2
(even though its files are named sqlite for historical reasons, the port name is now
sqlite2). If you have previously installed the sqlite port, you should uninstall it
before installing sqlite2 and sqlite3.
2. Install the Ruby database libraries with RubyGems:
$ sudo gem install mysql
$ sudo gem install postgres
$ sudo gem install sqlite-ruby
$ sudo gem install sqlite3-ruby
Installing the mysql library is not strictly necessary; Rails includes a pure-Ruby
MySQL library in activerecord/lib/active_record/vendor/mysql.rb. This implementation
will be used if no native mysql extension is found, which is useful on systems
like Windows, where a Ruby interpreter can be more accessible than a C
compiler. Additionally, the postgres gem can be replaced by the postgres-pr
gem, which is also pure Ruby.


Pages:
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448