1

I tried installing devise but ran into a lot of migration issues so went ahead and uninstalled the gem. I tried running rake:db migrate, redo, reset, and drop and I still get this error even without Devise:

/Users/ashleighalmeida/mixi/config/initializers/devise.rb:3:in `<top (required)>': uninitialized constant Devise (NameError)
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:651:in `load_config_initializer'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `each'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `each'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `tsort_each_child'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:411:in `call'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `call'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
    from /Users/ashleighalmeida/mixi/config/environment.rb:5:in `<top (required)>'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:92:in `preload'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:143:in `serve'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/ashleighalmeida/.rbenv/versions/2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from -e:1:in `<main>'

How do I completely remove Devise from my migration? Thanks!

icecreamrabbit
  • 207
  • 1
  • 3
  • 12

1 Answers1

1

Seems like you forgot to remove Devise initializer, which lies here:

config/initializers/devise.rb
Rustam Gasanov
  • 15,290
  • 8
  • 59
  • 72
  • hey thanks, i went to manually delete it, tried rake:db:migrate and got the same error but with undefined method `devise_for' for # (NoMethodError) on top :( – icecreamrabbit Aug 02 '15 at 13:06
  • @icecreamrabbit now go to your `config/routes.rb` and remove devise routes :) there would be a string, something like `devise_for :users` – Rustam Gasanov Aug 02 '15 at 13:08
  • now i get : SQLite3::SQLException: duplicate column name: email: ALTER TABLE "users" ADD "email" varchar DEFAULT '' NOT NULL/Users/ashleighalmeida/mixi/db/migrate/20150802125451_add_devise_to_users.rb:5:in `block in up' /Users/ashleighalmeida/mixi/db/migrate/20150802125451_add_devise_to_users.rb:3:in `up' -e:1:in `
    ' ActiveRecord::StatementInvalid: SQLite3::SQLException: duplicate column name: email: ALTER TABLE "users" ADD "email" varchar DEFAULT '' NOT NULL /Users/ashleighalmeida/mixi/db/migrate/20150802125451_add_devise_to_u`up' + more list ;( thanks tho
    – icecreamrabbit Aug 02 '15 at 13:16
  • @icecreamrabbit don't know what to say, error says it all, you want to add existing column to the table. if it's your playground, just try to rebuild your database, [follow these instructions](http://stackoverflow.com/questions/9896488/rake-dbmigrate-is-not-working/9897021#9897021). – Rustam Gasanov Aug 02 '15 at 13:22