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:inblock 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:inload!’
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:inroutes’
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:ininstance_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:indraw’
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:inblock 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:inload_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:inreload_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:inprepare!’
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:ininstance_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:inblock 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:inrun_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:inmethod_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:inblock
in

' 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 `' 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 ' 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 `' from script/rails:6:in `require' from script/rails:6:in `'

Thanks in advance.

regards,
Loganathan

On 26 January 2012 08:10, Loganathan S. [email protected]
wrote:

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:inblock 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:inload!’
/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:inroutes’
/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:ininstance_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:indraw’
/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:inblock 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:inload_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:inreload_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:inblock 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:inexecute_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:inprepare!’
/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:ininstance_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:inblock 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:inrun_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:inmethod_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:inrequire_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:incall’
/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:ineach’
/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:inblock 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:ininvoke_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:ineach’
/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:inblock 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:ininvoke_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:ininvoke_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:ineach’
/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:instandard_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:inblock 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:inrun’
/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:inload’
/home/logs/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `’
Tasks: TOP => db:migrate => environment

regards,
Loganathan

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs