-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
uninitialized constant Administrate::Generators::InstallGenerator::DashboardManifest #431
Comments
I was getting this for hours : ´´´ ´´´ But after installing for 10 times now its working, the reason? i don't know u.u |
Hi, I'm having the same problem. Did you figure this out? I get this error: Reading some of the blogs about this, it seems that it might be related to spring gem or HABTM relationships which are defined incorrectly. I'm not sure if there is a suggested solution. Have you figured out how to fix this? Thanks |
Well when you "rails generate administrate:install" the routes appear in the config/routes.rb file, and those line generate the error. So, i "rails generate administrate:install" and then removed that lines from config/routes.rb file like 10 times, maybe is what you are saying (the spring gem) or something more complicated. |
But don't you need the routes for the gem to work? It put these lines in my routes file: namespace :admin do
end Are you saying the solution is to delete all of this? |
Im saying that you should delete them and try to install administrate again(when you install it again the routes will appear again on the routes file), then test if it works. I did many times. |
I was also getting this error. i deleted the lines it added in my routes then ran |
thanks Quintin - that worked for me too |
Yes that makes sense, spring always causing problems |
|
Works for me too! Thanks 😃 |
Worked for me too. Thank you. |
I ran into this issue as well. Turns out I had my rails server running when I tried to run the |
DISABLE_SPRING=1 rails generate administrate:install works fine. |
@MincePie 👍 deleting the routes and reinstalling worked for me |
Problem: When users run the `administrate:install` generator multiple times, the generated routes from the first install prevent following installs from working correctly. In order to get subsequent installs to run correctly, users must delete the already-generated routes and run the installer again from scratch. This has thrown many people off, and there is discussion of the issue in: - #431 - #448 Solution: We should change the generated routes so they don't rely on a `DashboardManifest` being defined. I'm not sure what the best way to do that would be, but here are a couple options Defining routes directly This option would look something like: ```ruby namespace :admin do resources :customers resources :orders resources :products resources :line_items root to: "customers#index" end ``` That would fix the error that people are getting when they run `rails generate administrate:install` multiple times, but it would be more work to update the routes if they change over time. If we went this route, I'd want to look into getting rid of the `DashboardManifest` completely. It would be cumbersome to update the list of dashboards in multiple locations, and we could potentially look at the routes that the user's defined to determine which sidebar links to display. Wrap routes in a conditional Alternatively we could keep it how it is, but wrap the block in a conditional - that might look like: ```ruby if defined?(DashboardManifest) namespace :admin do DashboardManifest::DASHBOARDS.each do |dashboard_resource| resources dashboard_resource end root controller: DashboardManifest::ROOT_DASHBOARD, action: :index end end ``` Define routes through the engine This is the approach that RailsAdmin and Active Admin take. It would look like: ```ruby Rails.application.routes.draw do mount :administrate end ``` This approach is rather opaque, and it makes it harder for the developer to see what's going on. Behind the scenes we could use any approach we wanted to make sure the `DashboardManifest` is defined when we need it. Thoughts? What's the best approach to take here? - Are we comfortable mounting an engine and abstracting away the complexity? - Is it worth it to introduce a conditional check into peoples' routes file? - Would we prefer to get rid of the `DashboardManifest` altogether, and use the user's routes to fill that role instead?
I created issue #464 to discuss ways to get around the routes error. @frabrunelle, @Xosmond, @MincePie, @QuintinAdam, @s2t2 and others, please join the discussion there! |
Fixed by #464, which will go out in |
rails generate administrate:install 現在 springが動いている状態で上記コマンドを実行するとエラーが発生して実行が途中で止まってしまう。 ref: thoughtbot/administrate#431
Hi 😃
When I run the installer for Administrate, I get the following error:
Is anyone else getting this error? I get this error even on a totally new Rails application, so it should be pretty easy to reproduce.
The text was updated successfully, but these errors were encountered: