Rails_admin capistrano部署错误

时间:2017-08-08 13:38:25

标签: ruby-on-rails ruby-on-rails-4 rails-admin

当我部署我的项目时,我有一些错误

00:19 deploy:migrating
      01 ~/.rvm/bin/rvm default do bundle exec rake db:migrate
      01 rake aborted!
      01 NoMethodError: undefined method `date_format' for #<RailsAdmin::Config::Fields::Types::String:0x0000000686e768>
      01 /home/deployer/staging/blabla/releases/20170808132418/config/initializers/rails_admin.rb:60:in `block (4 levels) in <top (required)>'
      01 /home/deployer/staging/blabla/shared/bundle/ruby/2.3.0/gems/rails_admin-0.8.1/lib/rails_admin/config/has_fields.rb:38:in `instance_eval'
      01 /home/deployer/staging/blabla/shared/bundle/ruby/2.3.0/gems/rails_admin-0.8.1/lib/rails_admin/config/has_fields.rb:38:in `field'
      01 /home/deployer/staging/blabla/releases/20170808132418/config/initializers/rails_admin.rb:59:in `block (3 levels) in <top (required)>'
      01 

在文件/config/initializers/rails_admin.rb中我有这段代码

config.model 'Administrator' do
    visible do
      bindings[:controller].current_user.is_admin?
    end
    label I18n.t("index_admin.menu_label.#{@abstract_model.model_name.underscore}.#{label.parameterize('_')}")
    label_plural I18n.t("index_admin.menu_label.#{@abstract_model.model_name.underscore}.#{label.parameterize('_')}")
    object_label_method do
      :custom_label_method
    end
    list do
      field :id
      field :email
      field :fname
      field :mname
      field :lname
      field :phone
    end
    edit do
      include_all_fields
      field :image do
        visible false
      end
      field :phone_confirmation_at do
        date_format :default
      end
    end
    navigation_icon 'icon-eye-open'
  end

第59行崩溃

 field :phone_confirmation_at do
    date_format :default
  end

我犯了错误?

我有红宝石2.3.0        铁轨4.2.7        rails_admin-0.8.1

0 个答案:

没有答案