sferik/rails_admin — Issue #968: Uninitialized constant RailsAdmin
Author: antoine-coopcom
Created: 2012-02-07 11:29:20+00:00
State: open

Hi, I just installed Rails_Admin and now routes seems broken on a Rails fresh install. As I'm new to Ruby and Rails, I really don't know what to do from here.

Here's my Full Trace :

NameError

uninitialized constant RailsAdmin

Rails.root: /home/mindraw/app
Application Trace | Framework Trace | Full Trace

config/routes.rb:3:in `block in '
vendor/cache/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/routing/route_set.rb:272:in `instance_exec'
vendor/cache/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/routing/route_set.rb:272:in `eval_block'
vendor/cache/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/routing/route_set.rb:249:in `draw'
config/routes.rb:1:in `'
vendor/cache/ruby/1.9.1/gems/railties-3.2.1/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
vendor/cache/ruby/1.9.1/gems/railties-3.2.1/lib/rails/application/routes_reloader.rb:40:in `each'
vendor/cache/ruby/1.9.1/gems/railties-3.2.1/lib/rails/application/routes_reloader.rb:40:in `load_paths'
vendor/cache/ruby/1.9.1/gems/railties-3.2.1/lib/rails/application/routes_reloader.rb:16:in `reload!'
vendor/cache/ruby/1.9.1/gems/railties-3.2.1/lib/rails/application/routes_reloader.rb:26:in `block in updater'
vendor/cache/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/file_update_checker.rb:78:in `call'
vendor/cache/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/file_update_checker.rb:78:in `execute'
vendor/cache/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/file_update_checker.rb:86:in `execute_if_updated'
vendor/cache/ruby/1.9.1/gems/railties-3.2.1/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
vendor/cache/ruby/1.9.1/gems/railties-3.2.1/lib/rails/application/finisher.rb:68:in `block (2 levels) in '
vendor/cache/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:451:in `_run__1642364264386461984__prepare__182077114012513950__callbacks'
vendor/cache/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:405:in `__run_callback'
vendor/cache/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
vendor/cache/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
vendor/cache/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
vendor/cache/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/reloader.rb:64:in `call'
vendor/cache/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
vendor/cache/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
vendor/cache/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
vendor/cache/ruby/1.9.1/gems/railties-3.2.1/lib/rails/rack/logger.rb:26:in `call_app'
vendor/cache/ruby/1.9.1/gems/railties-3.2.1/lib/rails/rack/logger.rb:16:in `call'
vendor/cache/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/request_id.rb:22:in `call'
vendor/cache/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
vendor/cache/ruby/1.9.1/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
vendor/cache/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
vendor/cache/ruby/1.9.1/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
vendor/cache/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/static.rb:53:in `call'
vendor/cache/ruby/1.9.1/gems/railties-3.2.1/lib/rails/engine.rb:479:in `call'
vendor/cache/ruby/1.9.1/gems/railties-3.2.1/lib/rails/application.rb:220:in `call'
vendor/cache/ruby/1.9.1/gems/railties-3.2.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/utils.rb:479:in `safe_fork'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:180:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
:10:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.11/helper-scripts/passenger-spawn-server:99:in `

'

This error occurred while loading the following files:
/home/mindraw/app/config/routes.rb

-

Also while refreshing I sometimes get this error :

Routing Error

No route matches [GET] "/admin"

Try running rake routes for more information on available routes.

-

Then I tried to run rake routes and it gives me this output :

rails_admin /admin RailsAdmin::Engine
new_admin_session GET /admins/sign_in(.:format) devise/sessions#new
admin_session POST /admins/sign_in(.:format) devise/sessions#create
destroy_admin_session DELETE /admins/sign_out(.:format) devise/sessions#destroy
admin_password POST /admins/password(.:format) devise/passwords#create
new_admin_password GET /admins/password/new(.:format) devise/passwords#new
edit_admin_password GET /admins/password/edit(.:format) devise/passwords#edit
PUT /admins/password(.:format) devise/passwords#update
cancel_admin_registration GET /admins/cancel(.:format) devise/registrations#cancel
admin_registration POST /admins(.:format) devise/registrations#create
new_admin_registration GET /admins/sign_up(.:format) devise/registrations#new
edit_admin_registration GET /admins/edit(.:format) devise/registrations#edit
PUT /admins(.:format) devise/registrations#update
DELETE /admins(.:format) devise/registrations#destroy
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
user_password POST /users/password(.:format) devise/passwords#create
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
PUT /users/password(.:format) devise/passwords#update
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel
user_registration POST /users(.:format) devise/registrations#create
new_user_registration GET /users/sign_up(.:format) devise/registrations#new
edit_user_registration GET /users/edit(.:format) devise/registrations#edit
PUT /users(.:format) devise/registrations#update
DELETE /users(.:format) devise/registrations#destroy
root / home#index

Routes for RailsAdmin::Engine:
dashboard GET / rails_admin/main#dashboard
index GET|POST /:model_name(.:format) rails_admin/main#index
new GET|POST /:model_name/new(.:format) rails_admin/main#new
export GET|POST /:model_name/export(.:format) rails_admin/main#export
bulk_delete POST|DELETE /:model_name/bulk_delete(.:format) rails_admin/main#bulk_delete
history_index GET /:model_name/history(.:format) rails_admin/main#history_index
bulk_action POST /:model_name/bulk_action(.:format) rails_admin/main#bulk_action
show GET /:model_name/:id(.:format) rails_admin/main#show
edit GET|PUT /:model_name/:id/edit(.:format) rails_admin/main#edit
delete GET|DELETE /:model_name/:id/delete(.:format) rails_admin/main#delete
history_show GET /:model_name/:id/history(.:format) rails_admin/main#history_show
show_in_app GET /:model_name/:id/show_in_app(.:format) rails_admin/main#show_in_app

Is there anything I can do ?

Thanks in advance,
Antoine