Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rails g install error #613

Closed
civcastillo opened this issue Jun 16, 2016 · 4 comments
Closed

rails g install error #613

civcastillo opened this issue Jun 16, 2016 · 4 comments

Comments

@civcastillo
Copy link

I haven't been able to install administrate

Already took a look at #516 but still no luck


Running via Spring preloader in process 8585
identical app/controllers/admin/application_controller.rb
identical app/dashboards/user_dashboard.rb
identical app/controllers/admin/users_controller.rb
/.gem/ruby/2.3.0/gems/activerecord-4.2.6/lib/active_record/reflection.rb:883:in derive_class_name': undefined methodclass_name' for nil:NilClass (NoMethodError)
Did you mean? class_eval
from /.gem/ruby/2.3.0/gems/activerecord-4.2.6/lib/active_record/reflection.rb:157:in class_name' from /.gem/ruby/2.3.0/gems/administrate-0.2.2/lib/generators/administrate/dashboard/dashboard_generator.rb:111:inrelationship_options_string'
from /.gem/ruby/2.3.0/gems/administrate-0.2.2/lib/generators/administrate/dashboard/dashboard_generator.rb:98:in association_type' from /.gem/ruby/2.3.0/gems/administrate-0.2.2/lib/generators/administrate/dashboard/dashboard_generator.rb:61:inredundant_attributes_for'
from /.gem/ruby/2.3.0/gems/administrate-0.2.2/lib/generators/administrate/dashboard/dashboard_generator.rb:56:in block in redundant_attributes' from /.gem/ruby/2.3.0/gems/administrate-0.2.2/lib/generators/administrate/dashboard/dashboard_generator.rb:55:ineach'
from /.gem/ruby/2.3.0/gems/administrate-0.2.2/lib/generators/administrate/dashboard/dashboard_generator.rb:55:in flat_map' from /.gem/ruby/2.3.0/gems/administrate-0.2.2/lib/generators/administrate/dashboard/dashboard_generator.rb:55:inredundant_attributes'
from /.gem/ruby/2.3.0/gems/administrate-0.2.2/lib/generators/administrate/dashboard/dashboard_generator.rb:47:in attributes' from (erb):11:intemplate'
from /.rubies/ruby-2.3.0/lib/ruby/2.3.0/erb.rb:864:in eval' from /.rubies/ruby-2.3.0/lib/ruby/2.3.0/erb.rb:864:inresult'
from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/actions/file_manipulation.rb:116:in block in template' from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:53:inrender'
from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:46:in identical?' from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:72:inon_conflict_behavior'
from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:113:in invoke_with_conflict_check' from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:60:ininvoke!'
from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/actions.rb:94:in action' from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:25:increate_file'
from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/actions/file_manipulation.rb:115:in template' from /.gem/ruby/2.3.0/gems/railties-4.2.6/lib/rails/generators/named_base.rb:26:inblock in template'
from /.gem/ruby/2.3.0/gems/railties-4.2.6/lib/rails/generators/named_base.rb:60:in inside_template' from /.gem/ruby/2.3.0/gems/railties-4.2.6/lib/rails/generators/named_base.rb:25:intemplate'
from /.gem/ruby/2.3.0/gems/administrate-0.2.2/lib/generators/administrate/dashboard/dashboard_generator.rb:30:in create_dashboard_definition' from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:inrun'
from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:inblock in invoke_all'
from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in each' from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:inmap'
from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in invoke_all' from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/group.rb:232:indispatch'
from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in start' from /.gem/ruby/2.3.0/gems/railties-4.2.6/lib/rails/generators.rb:157:ininvoke'
from /.gem/ruby/2.3.0/gems/administrate-0.2.2/lib/administrate/generator_helpers.rb:4:in call_generator' from /.gem/ruby/2.3.0/gems/administrate-0.2.2/lib/generators/administrate/install/install_generator.rb:27:inblock in run_dashboard_generators'
from /.gem/ruby/2.3.0/gems/administrate-0.2.2/lib/generators/administrate/install/install_generator.rb:26:in each' from /.gem/ruby/2.3.0/gems/administrate-0.2.2/lib/generators/administrate/install/install_generator.rb:26:inrun_dashboard_generators'
from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command'
from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in block in invoke_all' from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:ineach'
from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in map' from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:ininvoke_all'
from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/group.rb:232:in dispatch' from /.gem/ruby/2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:instart'
from /.gem/ruby/2.3.0/gems/railties-4.2.6/lib/rails/generators.rb:157:in invoke' from /.gem/ruby/2.3.0/gems/railties-4.2.6/lib/rails/commands/generate.rb:13:in<top (required)>'
from /.gem/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in require' from /.gem/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:inblock in require'
from /.gem/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in load_dependency' from /.gem/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:inrequire'
from /.gem/ruby/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:123:in require_command!' from /.gem/ruby/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:130:ingenerate_or_destroy'
from /.gem/ruby/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:50:in generate' from /.gem/ruby/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:inrun_command!'
from /.gem/ruby/2.3.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in <top (required)>' from /.gem/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:inrequire'
from /.gem/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in block in require' from /.gem/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:inload_dependency'
from /.gem/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in require' from /bin/rails:9:in<top (required)>'
from /.gem/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in load' from /.gem/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:inblock in load'
from /.gem/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in load_dependency' from /.gem/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:inload'
from /.rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /.rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from -e:1:in `

'

@civcastillo
Copy link
Author

The source of this error was a has_many through association in one of my models.. I don't understand why because everything in my db/model is set up correctly

I was able to run the installer successfully after removing that association from one of my models

@nickcharlton
Copy link
Member

Closing as this should be fixed with #713. Please open an issue if that's not the case!

@ckgagan
Copy link

ckgagan commented Sep 6, 2017

@nickcharlton I got the same problem for rails 5.1.3 and administrate 0.8.1.

/home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.1.3/lib/active_record/reflection.rb:1013:in derive_class_name': undefined method class_name' for nil:NilClass (NoMethodError)
Did you mean? class_eval
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.1.3/lib/active_record/reflection.rb:170:in class_name' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/administrate-736266dd81f0/lib/generators/administrate/dashboard/dashboard_generator.rb:115:in relationship_options_string'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/administrate-736266dd81f0/lib/generators/administrate/dashboard/dashboard_generator.rb:102:in association_type' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/administrate-736266dd81f0/lib/generators/administrate/dashboard/dashboard_generator.rb:61:in redundant_attributes_for'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/administrate-736266dd81f0/lib/generators/administrate/dashboard/dashboard_generator.rb:56:in block in redundant_attributes' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/administrate-736266dd81f0/lib/generators/administrate/dashboard/dashboard_generator.rb:55:in each'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/administrate-736266dd81f0/lib/generators/administrate/dashboard/dashboard_generator.rb:55:in flat_map' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/administrate-736266dd81f0/lib/generators/administrate/dashboard/dashboard_generator.rb:55:in redundant_attributes'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/administrate-736266dd81f0/lib/generators/administrate/dashboard/dashboard_generator.rb:47:in attributes' from (erb):11:in template'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/2.3.0/erb.rb:864:in eval' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/2.3.0/erb.rb:864:in result'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/file_manipulation.rb:116:in block in template' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/create_file.rb:53:in render'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/create_file.rb:46:in identical?' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/create_file.rb:72:in on_conflict_behavior'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/empty_directory.rb:113:in invoke_with_conflict_check' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/create_file.rb:60:in invoke!'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions.rb:95:in action' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/create_file.rb:25:in create_file'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/actions/file_manipulation.rb:115:in template' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3/lib/rails/generators/named_base.rb:26:in block in template'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3/lib/rails/generators/named_base.rb:68:in inside_template' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3/lib/rails/generators/named_base.rb:25:in template'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/administrate-736266dd81f0/lib/generators/administrate/dashboard/dashboard_generator.rb:30:in create_dashboard_definition' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in run'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in invoke_command' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in block in invoke_all'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in each' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in map'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in invoke_all' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/group.rb:232:in dispatch'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/base.rb:444:in start' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3/lib/rails/generators.rb:269:in invoke'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/administrate-736266dd81f0/lib/administrate/generator_helpers.rb:4:in call_generator' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/administrate-736266dd81f0/lib/generators/administrate/install/install_generator.rb:27:in block in run_dashboard_generators'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/administrate-736266dd81f0/lib/generators/administrate/install/install_generator.rb:26:in each' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/administrate-736266dd81f0/lib/generators/administrate/install/install_generator.rb:26:in run_dashboard_generators'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in run' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in invoke_command'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in block in invoke_all' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in each'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in map' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:133:in invoke_all'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/group.rb:232:in dispatch' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/base.rb:444:in start'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3/lib/rails/generators.rb:269:in invoke' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3/lib/rails/commands/generate/generate_command.rb:24:in perform'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in run' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in invoke_command'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor.rb:369:in dispatch' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3/lib/rails/command/base.rb:63:in perform'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3/lib/rails/command.rb:44:in invoke' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.1.3/lib/rails/commands.rb:16:in <top (required)>'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in require' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in block in require'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:258:in load_dependency' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in require'
from /home/ckgagan/dev/home/krishna/globalmultiservices/bin/rails:9:in <top (required)>' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:286:in load'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:286:in block in load' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:258:in load_dependency'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:286:in load' from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /home/ckgagan/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from -e:1:in

'

@nickcharlton
Copy link
Member

@ckgagan If this is a problem you're still having, could you open a new issue with details of your model setup/etc so we can try and replicate it? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants