Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Error initializing rails admin #1365

Closed
ashrafuzzaman opened this Issue · 2 comments

2 participants

@ashrafuzzaman

I am using postgre and when running

rails g rails_admin:install

I am getting the following error,

create  config/initializers/rails_admin.rb.example
/home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1139:in `async_exec': PG::Error: ERROR:  relation "fields" does not exist (ActiveRecord::StatementInvalid)
LINE 4:              WHERE a.attrelid = '"fields"'::regclass
                                        ^
:             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
              FROM pg_attribute a LEFT JOIN pg_attrdef d
                ON a.attrelid = d.adrelid AND a.attnum = d.adnum
             WHERE a.attrelid = '"fields"'::regclass
               AND a.attnum > 0 AND NOT a.attisdropped
             ORDER BY a.attnum
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1139:in `exec_no_cache'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:663:in `block in exec_query'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:662:in `exec_query'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1264:in `column_definitions'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:858:in `columns'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.3/lib/active_record/connection_adapters/schema_cache.rb:12:in `block in initialize'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.3/lib/active_record/model_schema.rb:228:in `yield'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.3/lib/active_record/model_schema.rb:228:in `default'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.3/lib/active_record/model_schema.rb:228:in `columns'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/rails_admin-0.1.2/lib/rails_admin/adapters/active_record.rb:84:in `properties'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/rails_admin-0.1.2/lib/rails_admin/config/fields.rb:50:in `factory'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/rails_admin-0.1.2/lib/rails_admin/config/has_fields.rb:129:in `_fields'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/rails_admin-0.1.2/lib/rails_admin/config/has_fields.rb:127:in `_fields'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/rails_admin-0.1.2/lib/rails_admin/config/has_fields.rb:107:in `all_fields'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/rails_admin-0.1.2/lib/rails_admin/config/has_fields.rb:82:in `fields'
    from (erb):64:in `block in template'
    from (erb):53:in `map'
    from (erb):53:in `template'
    from /home/jitu/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/erb.rb:838:in `eval'
    from /home/jitu/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/erb.rb:838:in `result'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/file_manipulation.rb:111:in `block in template'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/create_file.rb:54:in `call'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/create_file.rb:54:in `render'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in `block (2 levels) in invoke!'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in `open'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in `block in invoke!'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:114:in `call'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:114:in `invoke_with_conflict_check'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/create_file.rb:61:in `invoke!'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions.rb:95:in `action'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/create_file.rb:26:in `create_file'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/actions/file_manipulation.rb:110:in `template'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/rails_admin-0.1.2/lib/generators/rails_admin/install_generator.rb:66:in `install'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.3/lib/rails/generators.rb:170:in `invoke'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.3/lib/rails/commands/generate.rb:12:in `<top (required)>'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /home/jitu/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.3/lib/rails/commands.rb:29:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
@mshibuya
Collaborator

It is likely that some of your models are not properly configured.
Can you paste them here?

@ashrafuzzaman

Hi,
Now I could get it to work. Dont know what happened. Thanks for your time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.