Administrate: uninitialized constant Admin::Administrate

Created on 29 Apr 2017  路  9Comments  路  Source: thoughtbot/administrate

Hi, after I ran rails generate administrate:install
I tried to access the admin through url by putting /admin at the end but it gave me an error saying
uninitialized constant Admin::Administrate.
Here is a screenshot of the error message.
screenshot 2017-04-29 17 24 48

Here is a screenshot of my workspace.
screenshot 2017-04-29 17 27 19

What is the problem?

Most helpful comment

(this can also happen if you forgot to include the administrate gem for some reason or another... happened to a friend of mine that definitely wasn't me)

All 9 comments

Can we see the offending code inside of your ApplicationController?

This is my original ApplicationController

screenshot 2017-04-29 17 49 09

and this is my admin ApplicationController
screenshot 2017-04-29 17 49 04

and this is what i have in my route.rb

Rails.application.routes.draw do

  namespace :admin do
    resources :users
    resources :posts

    root to: "posts#index"
  end

  devise_for :users
  resources :posts

I don't think your application is aware of the Administrate module. It looks like an issue that's possibly in your Gemfile. You'll need to make sure you have administrate in your Gemfile and everything has properly booted.

If there's any more details that you can provide me as you debug, that'd be helpful. For now, I have to close this as I don't think this may be an issue with the project.

I have the identical issue and setup. Here is the result of running bundle install to confirm gem:

Using administrate 0.8.1
Bundle complete! 37 Gemfile dependencies, 155 gems now installed.
Bundled gems are installed into /usr/local/bundle.

I then ran

rails destroy administrate:install

I removed the gem, re-ran bundle install, re-installed the gem, re-ran the install and got the same issue.

NOTE: When I started this process I had a Devise user called "Admin". I removed it completely and replaced it with "SuperAdmin" - as per instructions elsewhere for using Administrate. Is it possible that I have not yet succeed in fully removing Administrate's hidden files somewhere that still hold onto the conflicting "Admin" administration files?

Look to your routes, I've got the same problem because of my custom routes inside :admin namespace

This issue is quite old now, please open a new one if you're still having problems.

(this can also happen if you forgot to include the administrate gem for some reason or another... happened to a friend of mine that definitely wasn't me)

try restarting and run bundle install again. that solved my problem.

Was this page helpful?
0 / 5 - 0 ratings