Skip to content

Instantly share code, notes, and snippets.

@mdluo
Forked from namukang/rails-setup.md
Last active August 29, 2015 14:14
Show Gist options
  • Save mdluo/ee588e6ce96693c196c4 to your computer and use it in GitHub Desktop.
Save mdluo/ee588e6ce96693c196c4 to your computer and use it in GitHub Desktop.

Installation

Install the following:

  • Git
  • rbenv
  • Ruby
  • MySQL
  • PostgreSQL
  • SQLite3
  • Memcached

Running tests

Active Support

cd rails/activesupport
rake test

Active Record

cd rails/activerecord
rake test

Potential Errors

Error:

Access denied for user ''@'localhost' to database 'activerecord_unittest' (Mysql::Error)

Solution:

mysql -uroot
mysql> GRANT ALL PRIVILEGES ON activerecord_unittest.* to 'rails'@'localhost';
mysql> GRANT ALL PRIVILEGES ON activerecord_unittest2.* to 'rails'@'localhost';
mysql> GRANT ALL PRIVILEGES ON inexistent_activerecord_unittest.* to 'rails'@'localhost';

Error:

Unknown database 'activerecord_unittest' (ActiveRecord::NoDatabaseError)

Solution:

rake mysql:build_databases

Error:

FATAL:  database "activerecord_unittest" does not exist (ActiveRecord::NoDatabaseError)

Solution:

rake postgresql:build_databases

Errors you can ignore (according to the mentors)

test_mysql, test_mysql2

DefaultsTestWithoutTransactionalFixtures#test_mysql_text_not_null_defaults_non_strict:
ActiveRecord::StatementInvalid: Mysql::Error: Field 'non_null_text' doesn't have a default value: INSERT INTO             `test_mysql_text_not_null_defaults` VALUES ()

test_postgresql

TimestampTest#test_bc_timestamp:
ActiveRecord::StatementInvalid: PG::DatetimeFieldOverflow: ERROR:  date/time field value out of range: "0000-01-01 07:59:59.000000 BC": INSERT INTO "developers" ("created_at", "created_on", "name", "updated_at", "updated_on") VALUES ($1, $2, $3, $4, $5) RETURNING "id"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment