Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATCH] boot.rb doesn't take --skip-activerecord into account

#3711

2010-01-16 12:44:37

followed instructions at http://blog.envylabs.com/2010/01/getting-started-with-the-rails-3-b...

  • generated new application with --dev -JO. (I skipped ActiveRecord so I could use DataMapper.)
  • ./script/generate (with no options)
    • errors out with the following: /home/thomas/Code/rails3/railties/lib/rails/configuration.rb:162:in read': No such file or directory - /home/thomas/Code/rg-scratchpad/config/database.yml (Errno::ENOENT)

config/database.yml doesn't exist, but I'm assuming that is because of the -O flag. If that is the case, I should see a friendly warning, at most. Better would be to skip loading this file if ActiveRecord not loaded. Or at least checking to see if it exists before loading it. Just my two cents.... Here is the full stack-trace:

/home/thomas/Code/rails3/railties/lib/rails/configuration.rb:162:in read': No such file or directory - /home/thomas/Code/rg-scratchpad/config/database.yml (Errno::ENOENT)

  • from /home/thomas/Code/rails3/railties/lib/rails/configuration.rb:162:in database_configuration'
  • from /home/thomas/Code/rails3/activerecord/lib/active_record/railtie.rb:30
  • from /home/thomas/Code/rails3/railties/lib/rails/initializable.rb:29:in instance_exec'
  • from /home/thomas/Code/rails3/railties/lib/rails/initializable.rb:29:in run'
  • from /home/thomas/Code/rails3/railties/lib/rails/initializable.rb:67:in run_initializers'
  • from /home/thomas/Code/rails3/railties/lib/rails/initializable.rb:66:in each'
  • from /home/thomas/Code/rails3/railties/lib/rails/initializable.rb:66:in run_initializers'
  • from /home/thomas/Code/rails3/railties/lib/rails/application.rb:38:in initialize!'
  • from /home/thomas/Code/rails3/railties/lib/rails/application.rb:12:in __send__'
  • from /home/thomas/Code/rails3/railties/lib/rails/application.rb:12:in initialize!'
  • from /home/thomas/Code/rg-scratchpad/config/environment.rb:5
  • from script/generate:2:in require'
  • from script/generate:2

Reported by ravinggenius · January 16th, 2010 @ 06:16 PM

State: committed
Milestone: none
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. José Valim
    José Valim
    • Assigned user set to José Valim

    January 16th, 2010 @ 09:44 PM

  2. Rizwan Reza
    Rizwan Reza
    • Tag set to 3.0, bugmash, patch, review
    • Title changed from script/generate fails when config/database.yml doesn't exist to [PATCH] boot.rb doesn't take --skip-activerecord into account

    Basically, the error is because boot.rb is not being changed to not require ActiveRecord. This patch fixes that and also a test which was commented out.

    I've verified this by reapplying it to master. All tests pass.

    January 16th, 2010 @ 10:40 PM

  3. Repository
  4. José Valim
    José Valim
    • State changed from new to committed

    January 17th, 2010 @ 01:58 PM