Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.11.x: rake ar:schema:load results in "undefined method define for ActiveRecord::Schema:Class #1247

Closed
dannguyen opened this issue Apr 16, 2013 · 1 comment
Milestone

Comments

@dannguyen
Copy link

Using:
Ruby 1.9.3-head
padrino 0.11.1
ActiveRecord 3.2.13
rake 10.0.4

The rake ar:migrate tasks work as expected, but I'm getting a bizarre error when I do rake ar:schema:load

  undefined method `define' for ActiveRecord::Schema:Class
  /home/project/db/schema.rb:14:in `<top (required)>'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/padrino-gen-0.11.0/lib/padrino-gen/padrino-tasks/activerecord.rb:247:in `block (3 levels) in <top (required)>'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
  /home/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
  /home/.rvm/gems/ruby-1.9.3-head@mta/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
  /home/.rvm/gems/ruby-1.9.3-head@mta/bin/rake:23:in `load'
  /home/.rvm/gems/ruby-1.9.3-head@mta/bin/rake:23:in `<main>'
  /home/.rvm/gems/ruby-1.9.3-head@mta/bin/ruby_noexec_wrapper:14:in `eval'
  /home/.rvm/gems/ruby-1.9.3-head@mta/bin/ruby_noexec_wrapper:14:in `<main>'
  Tasks: TOP => ar:schema:load

It doesn't make sense to me why define in ActiveRecord::Schema:Class would be undefined...when ActiveRecord::Schema (and all other parts of AR) seem to work as expected.

@rudywhip
Copy link

Had same issue. Traced to padrino-gen. Resolved by requiring active_record before PadrinoTasks.init in Rakefile.

@Ortuna Ortuna closed this as completed in cffd021 Jun 7, 2013
Ortuna added a commit that referenced this issue Jun 7, 2013
Ensure requiring active_record, fix #1247
WaYdotNET added a commit to WaYdotNET/padrino-framework that referenced this issue Jun 10, 2013
* upstream/master:
  See if 1.5.10 works with PR before merge
  Lock nokogiri to 1.5.9 since it droped support for 1.8
  Ensure requiring active_record, fix padrino#1247
deni64k pushed a commit to deni64k/padrino-framework that referenced this issue Jul 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants