undefined method `devise' for User(no database connection):Class

Hi All,

I am getting the error mentioned in SUBJECT while fetching the user model. I am using three different database in my application. Can I use devise gem for authentication user table in different database?

Did you run rails generate devise:install, rails generate devise User
and rake db:migrate?


Hi Colin,

Thanks. Now its working. I have used connection_ninja gem for connecting more that one database in my application. After correcting the environment configurations in proper sequence in yml file, everything started to working…