这是我运行安装程序时显示的内容。输出很奇怪,有一些关于外键和反射的抱怨。source_reflection 为零?关于修复的任何想法?
此外,除非我添加一堆额外的运球来填写此表格,否则不让我发布这个问题真的很烦人。来吧!
- Hello, RailsAdmin installer will help you set 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've already installed it, good!
? Where do you want to mount rails_admin? Press <enter> for [admin] >
gsub config/routes.rb
route mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'
- And you already set it up, good! We just need to know about your user model name...
- We found 'user' (should be one of 'user', 'admin', etc.)
? Correct Devise model name if needed. Press <enter> for [user] > admin
- Now setting up devise with user model name 'admin':
generate devise
invoke active_record
create db/migrate/20131114155103_add_devise_to_admins.rb
insert app/models/admin.rb
route devise_for :admins
- Now you'll need an initializer...
create config/initializers/rails_admin.rb
/Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/activerecord-4.0.0/lib/active_record/reflection.rb:401:in `rescue in foreign_key': ActiveRecord::Reflection::ThroughReflection#foreign_key delegated to source_reflection.foreign_key, but source_reflection is nil: #<ActiveRecord::Reflection::ThroughReflection:0x007f87de0c5bd0 @macro=:has_many, @name=:transactions, @scope=nil, @options={:through=>:locatables}, @active_record=Address(id: integer, street: string, city: string, state: string, zip: string, country: string, created_at: datetime, updated_at: datetime, latitude: float, longitude: float), @plural_name="transactions", @collection=true, @source_reflection_names=[:transaction, :transactions], @through_reflection=#<ActiveRecord::Reflection::AssociationReflection:0x007f87dafbb670 @macro=:has_many, @name=:locatables, @scope=nil, @options={}, @active_record=Address(id: integer, street: string, city: string, state: string, zip: string, country: string, created_at: datetime, updated_at: datetime, latitude: float, longitude: float), @plural_name="locatables", @collection=true, @foreign_key="address_id", @class_name="Locatable", @klass=Locatable(id: integer, owner_id: integer, owner_type: string, address_id: integer, created_at: datetime, updated_at: datetime, pickup: boolean, kind: string)>, @source_reflection=nil> (RuntimeError)
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/activerecord-4.0.0/lib/active_record/reflection.rb:397:in `foreign_key'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/adapters/active_record.rb:306:in `association_foreign_key_lookup'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/adapters/active_record.rb:72:in `block in associations'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/adapters/active_record.rb:65:in `map'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/adapters/active_record.rb:65:in `associations'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/config/fields/factories/association.rb:6:in `block in <top (required)>'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/config/fields.rb:54:in `call'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/config/fields.rb:54:in `block (2 levels) in factory'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/config/fields.rb:54:in `each'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/config/fields.rb:54:in `find'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/config/fields.rb:54:in `block in factory'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/config/fields.rb:50:in `each'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/config/fields.rb:50:in `factory'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/config/has_fields.rb:130:in `_fields'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/config/has_fields.rb:128:in `_fields'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/config/has_fields.rb:108:in `all_fields'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/rails_admin/config/has_fields.rb:83:in `fields'
from (erb):64:in `block in template'
from (erb):53:in `map'
from (erb):53:in `template'
from /Users/JCC/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/erb.rb:849:in `eval'
from /Users/JCC/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/erb.rb:849:in `result'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/actions/file_manipulation.rb:117:in `block in template'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/actions/create_file.rb:54:in `call'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/actions/create_file.rb:54:in `render'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/actions/create_file.rb:63:in `block (2 levels) in invoke!'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/actions/create_file.rb:63:in `open'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/actions/create_file.rb:63:in `block in invoke!'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/actions/empty_directory.rb:117:in `call'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/actions/empty_directory.rb:117:in `invoke_with_conflict_check'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/actions/create_file.rb:61:in `invoke!'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/actions.rb:95:in `action'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/actions/create_file.rb:26:in `create_file'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/actions/file_manipulation.rb:116:in `template'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/rails_admin-0.5.0/lib/generators/rails_admin/install_generator.rb:75:in `install'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `block in invoke_all'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `each'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `map'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `invoke_all'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/group.rb:233:in `dispatch'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/railties-4.0.0/lib/rails/generators.rb:156:in `invoke'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/railties-4.0.0/lib/rails/commands/generate.rb:11:in `<top (required)>'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /Users/JCC/.rvm/gems/ruby-2.0.0-p247@testing/gems/railties-4.0.0/lib/rails/commands.rb:49:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'