Take the 2-minute tour ×  I would to populate the database
(MySQL) with some dummy entries as the application starts.  I
created:  class DatabaseInitializer   def populate_database  in
lib/database_initializer.rb.  I understand that all files in the
lib directory should have been loaded automatically.  Question
1: Is there any command to see a list of all files that have
been loaded ?  Then, in controllers/main_controller.rb I have:
require 'lib/database_initializer.rb' class MainController <
ApplicationController   def initialize   def index  But, I got
the following error:  LoadError in MainController#index no such
file to load -- lib/database_initializer.rb  Question 2: Why it
cannot find database_initializer.rb ?  Question 3: Is this
"Rails enough" way to pre-populate a database ? Would you do
this otherwise (put database_initializer.rb in other place, call
DatabaseInitializer.new.populate_database from other place,
e.t.c.) ?  share|improve this question add comment  3 Answers
up vote 3 down vote accept