sferik/rails_admin — Issue #801: `compute_type': uninitialized constant Report::Medium (NameError)
Author: bcardarella
Created: 2011-10-26 03:57:59+00:00
State: open

I'm getting this stack trace when running the generator:

```
$ rails g rails_admin:install
- Hello, RailsAdmin installer will help you sets things up!
- I need to work with Devise, let's look at a few things first:
- Checking for a current installation of devise...
- Found it!
- Looks like you don't have devise installed! We'll install it for you:
generate devise:install
create config/initializers/devise.rb
create config/locales/devise.en.yml

===============================================================================

Some setup you must do manually if you haven't yet:

1. Setup default url options for your specific environment. Here is an
example of development environment:

config.action_mailer.default_url_options = { :host => 'localhost:3000' }

This is a required Rails configuration. In production it must be the
actual host of your application

2. Ensure you have defined root_url to *something* in your config/routes.rb.
For example:

root :to => "home#index"

3. Ensure you have flash messages in app/views/layouts/application.html.erb.
For example:

<%= notice %>

<%= alert %>

4. If you are deploying Rails 3.1 on Heroku, you may want to set:

config.assets.initialize_on_precompile = false

On config/application.rb forcing your application to not access the DB
or load models when precompiling your assets.

===============================================================================
? What would you like the user model to be called? Press for [user] >
- Now setting up devise with user model name 'user':
generate devise
invoke active_record
create db/migrate/20111026035552_add_devise_to_users.rb
insert app/models/user.rb
route devise_for :users
- Now you'll need an initializer...
- You already have a config file. You're updating, heh? I'm generating a new 'rails_admin.rb.example' that you can review.
create config/initializers/rails_admin.rb.example
/Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/base.rb:1341:in `compute_type': uninitialized constant Report::Medium (NameError)
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/reflection.rb:173:in `klass'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/adapters/active_record.rb:226:in `association_child_model_lookup'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/adapters/active_record.rb:121:in `block in associations'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/adapters/active_record.rb:114:in `map'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/adapters/active_record.rb:114:in `associations'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/adapters/active_record.rb:108:in `belongs_to_associations'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/config/fields.rb:22:in `block in '
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/config/fields.rb:67:in `call'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/config/fields.rb:67:in `block (2 levels) in factory'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/config/fields.rb:67:in `each'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/config/fields.rb:67:in `find'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/config/fields.rb:67:in `block in factory'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/config/fields.rb:63:in `each'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/config/fields.rb:63:in `factory'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/config/sections/export.rb:13:in `initialize'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/config/sections.rb:27:in `new'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/rails_admin/config/sections.rb:27:in `block (2 levels) in included'
from (erb):143:in `block in template'
from (erb):129:in `map'
from (erb):129:in `template'
from /Users/bcardarella/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/erb.rb:753:in `eval'
from /Users/bcardarella/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/erb.rb:753:in `result'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/file_manipulation.rb:111:in `block in template'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:54:in `call'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:54:in `render'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in `block (2 levels) in invoke!'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in `open'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in `block in invoke!'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:114:in `call'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:114:in `invoke_with_conflict_check'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:61:in `invoke!'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions.rb:95:in `action'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:26:in `create_file'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/file_manipulation.rb:110:in `template'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails_admin-c713d77cce50/lib/generators/rails_admin/install_generator.rb:61:in `install'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/generators.rb:168:in `invoke'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/generate.rb:12:in `'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /Users/bcardarella/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:28:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'
```