Problem while creating new resource on ActiveAdmin

HI All,

I have installed the Active Admin successfully, but facing the following error while restarting the server after generating an resource.
rails generate active_admin:resource item

/home/logs/Desktop/training/RAILS/courier/app/admin/items.rb:1:in <top (required)>': uninitialized constant Item (NameError) from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.1/lib/active_admin/application.rb:129:in block in load!’

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.1/lib/active_admin/application.rb:129:in `each'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.1/lib/active_admin/application.rb:129:in `load!'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.1/lib/active_admin/application.rb:152:in `routes'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.1/lib/active_admin.rb:63:in `routes'

from /home/logs/Desktop/training/RAILS/courier/config/routes.rb:3:in `block in <top (required)>'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.0/lib/action_dispatch/routing/route_set.rb:257:in `instance_exec'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.0/lib/action_dispatch/routing/route_set.rb:257:in `eval_block'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.0/lib/action_dispatch/routing/route_set.rb:234:in `draw'

from /home/logs/Desktop/training/RAILS/courier/config/routes.rb:1:in `<top (required)>'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/application/routes_reloader.rb:29:in `block in load_paths'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/application/routes_reloader.rb:29:in `each'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/application/routes_reloader.rb:29:in `load_paths'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/application/routes_reloader.rb:13:in `reload!'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/application.rb:83:in `reload_routes!'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.1/lib/active_admin/reloader.rb:17:in `block in attach!'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:404:in `_run_prepare_callbacks'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.0/lib/action_dispatch/middleware/reloader.rb:46:in `prepare!'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/application/finisher.rb:41:in `block in <module:Finisher>'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `instance_exec'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `run'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/initializable.rb:50:in `block in run_initializers'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `each'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `run_initializers'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/application.rb:92:in `initialize!'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing'

from /home/logs/Desktop/training/RAILS/courier/config/environment.rb:5:in `<top (required)>'
from /home/logs/Desktop/training/RAILS/courier/config.ru:4:in `block in <main>'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.6/lib/rack/builder.rb:51:in `instance_eval'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.6/lib/rack/builder.rb:51:in `initialize'
from /home/logs/Desktop/training/RAILS/courier/config.ru:1:in `new'
from /home/logs/Desktop/training/RAILS/courier/config.ru:1:in `<main>'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.6/lib/rack/builder.rb:40:in `eval'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.6/lib/rack/builder.rb:40:in `parse_file'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.6/lib/rack/server.rb:200:in `app'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands/server.rb:46:in `app'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.6/lib/rack/server.rb:301:in `wrapped_app'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.6/lib/rack/server.rb:252:in `start'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands/server.rb:70:in `start'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands.rb:54:in `block in <top (required)>'

from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands.rb:49:in `tap'
from /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands.rb:49:in `<top (required)>'

from script/rails:6:in `require'
from script/rails:6:in `<main>'

Thanks in advance.

regards,
Loganathan

HI All,

I have installed the Active Admin successfully, but facing the following
error while restarting the server after generating an resource.

 rails generate active\_admin:resource item

Did you remember to run migrate on the database?

Colin

Yeah I was able to execute rake db:migrate before creating the new resource, but after creating the resource it throws the same error. Please have a look on the below , do i need to create controller or model for Item to get it run?

/Desktop/training/RAILS/courier$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant Item

/home/logs/Desktop/training/RAILS/courier/app/admin/items.rb:1:in <top (required)>' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.4/lib/active_admin/application.rb:132:in block in load!’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.4/lib/active_admin/application.rb:132:in each' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.4/lib/active_admin/application.rb:132:in load!’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.4/lib/active_admin/application.rb:155:in routes' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.4/lib/active_admin.rb:63:in routes’
/home/logs/Desktop/training/RAILS/courier/config/routes.rb:2:in `block in <top (required)>’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/routing/route_set.rb:258:in instance_exec' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/routing/route_set.rb:258:in eval_block’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/routing/route_set.rb:235:in draw' /home/logs/Desktop/training/RAILS/courier/config/routes.rb:1:in <top (required)>’
/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application/routes_reloader.rb:29:in `block in load_paths’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application/routes_reloader.rb:29:in each' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application/routes_reloader.rb:29:in load_paths’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application/routes_reloader.rb:13:in reload!' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application.rb:87:in reload_routes!’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.4/lib/active_admin/reloader.rb:34:in reload!' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.4/lib/active_admin/reloader.rb:28:in block in initialize’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/file_update_checker.rb:32:in call' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/file_update_checker.rb:32:in execute_if_updated’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.4/lib/active_admin/reloader.rb:45:in block in attach!' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:404:in _run_prepare_callbacks’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/callbacks.rb:81:in run_callbacks' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/middleware/reloader.rb:46:in prepare!’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application/finisher.rb:41:in block in <module:Finisher>' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/initializable.rb:30:in instance_exec’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/initializable.rb:30:in run' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/initializable.rb:55:in block in run_initializers’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/initializable.rb:54:in each' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/initializable.rb:54:in run_initializers’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in method_missing' /home/logs/Desktop/training/RAILS/courier/config/environment.rb:5:in <top (required)>’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application.rb:83:in require_environment!' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application.rb:193:in block (2 levels) in initialize_tasks’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in call' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in block in execute’
/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in execute' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in block in invoke_with_call_chain’
/home/logs/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:176:in block in invoke_prerequisites’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in each' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in invoke_prerequisites’
/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain’

/home/logs/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in mon_synchronize' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain’
/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:116:in invoke_task' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in block (2 levels) in top_level’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in each' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in block in top_level’
/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:88:in top_level' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:66:in block in run’
/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling’

/home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in run' /home/logs/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in <top (required)>’
/home/logs/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load’

/home/logs/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `’
Tasks: TOP => db:migrate => environment

regards,
Loganathan