Question

Let me preface this by saying I'm a total rails noob.

I've just written a migration but when I try to run rake db:migrate --trace I get this error.

(in /home/dkerschner/hsp-agent)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment

rake aborted!
uninitialized constant ActionController
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in `load_missing_constant'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in `const_missing'
/var/lib/gems/1.8/gems/devise-0.9.1/lib/devise/rails/routes.rb:1
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/devise-0.9.1/lib/devise/rails.rb:1
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/devise-0.9.1/lib/devise.rb:229
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/home/dkerschner/hsp-agent/config/environment.rb:9
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/var/lib/gems/1.8/gems/rails-2.3.5/lib/tasks/misc.rake:4
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/var/lib/gems/1.8/gems/rake-0.8.7/bin/rake:31
/var/lib/gems/1.8/bin/rake:19:in `load'
/var/lib/gems/1.8/bin/rake:19

I'm trying to use devise which is where t.authenticatable comes from Here is my migration which is named 20100129183653_change_agent_staff.rb

class ChangeAgentStaff < ActiveRecord::Migration
  def self.up
    change_table :agent_staff do |t|
      t.authenticatable
      t.timestamps
    end
  end

  def self.down

  end
end

This is driving me nuts! What am I doing wrong?

Was it helpful?

Solution

I attempted to recreate this earlier, and it's not a problem in your migration. The problem is elsewhere, and you might want to see if you can cause the app to err out somewhere else. Fire up script/server and see if you can view those pages, or if an error is generated.

How far along is your application? If it's fairly new (and you know you have a valid rails 2.3.5 install) you might want to try starting from scratch. Set up authentication with devise, documenting your commands as you go. Then post all the commands and code you entered up to the point of failure, and we'll be better able to diagnose the problem.

I'm asking for this because as I tried to duplicate, there were just too many different ways to set this up - using the devise generators, or manually, and using devise from the start vs. tacking it on after the user model is already created.

Edit: There is no t.authenticable for devise in change_table at this time. You have to manually add the columns referenced by it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top